首页 > 解决方案 > Firebase ml视觉图像标签模型颤振依赖错误

问题描述

我正在尝试使用firebase_ml_vision 0.10.0;但是,当我在 android/app/build.gradle 中添加此依赖项时

我使用的依赖是 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2' <-- 这个依赖给了我一个依赖错误

android {
    dependencies {
    implementation platform('com.google.firebase:firebase-bom:26.4.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.google.firebase:firebase-ml-vision:24.0.1'
    implementation 'com.google.android.gms:play-services-vision:20.1.3'
    implementation 'com.google.android.gms:play-services-vision-common:19.1.3'
    implementation 'com.google.android.gms:play-services-vision-image-label:18.1.1'
//BOTTOM LINE DEPENDENCY ADDED
    implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2' <-- THIS LINE ADDED
}
}

我收到一个构建异常,说明:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[17.0.
  2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.firebase:firebase-ml-vision-image-label-model:17.0.2 -> com.google.android.gms:play-servi
  ces-vision-common@[17.0.2], but play-services-vision-common version was 19.1.3.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.android.gms:play-services-vision@{strictly 20.1.3}
  -- Project 'app' depends onto com.google.firebase:firebase-ml-vision-image-label-model@17.0.2
  -- Project 'app' depends onto com.google.firebase:firebase-bom@{strictly 26.4.0}
  -- Project 'app' depends onto com.google.firebase:firebase-ml-vision@18.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-bom@26.4.0
  -- Project 'app' depends onto com.google.firebase:firebase-ml-vision@{strictly 24.1.0}
  -- Project 'app' depends on project 'firebase_ml_vision' which depends onto com.google.firebase:firebase-ml-vision@20.0.
  0
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@{strictly 18.1.1}
  -- Project 'app' depends onto com.google.firebase:firebase-ml-vision-image-label-model@{strictly 17.0.2}
  -- Project 'app' depends onto com.google.android.gms:play-services-vision@20.1.3
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@18.1.1
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-common@19.1.3
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.3}

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = true }" to your bu
  ild.gradle file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 26s
Exception: Gradle task assembleDebug failed with exit code 1

我该怎么做才能修复这个依赖相关的错误?谢谢你。

标签: androidfirebaseflutterflutter-dependenciesfirebase-mlkit

解决方案


推荐阅读