Firebase ML Kit

3
尝试使用 Firebase ml kit 对标签进行操作,但在版本 firebase_ml_vision:^0.9.10 中遇到以下错误: 错误

Launching lib\main.dart on sdk gphone x86 arm in debug mode...
 lib\main.dart

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. "[19.0.
  2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-vision:20.0.0 -> com.google.android.gms:play-services-vision-co
  mmon@[19.0.2], but play-services-vision-common version was 19.1.0.

  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.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-common@{strictly 19.1.0}
  -- Project 'app' depends onto com.google.firebase:firebase-bom@26.2.0
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@{strictly 18.0.4}
  -- Project 'app' depends onto com.google.firebase:firebase-bom@{strictly 26.2.0}
  -- Project 'app' depends onto com.google.android.gms:play-services-vision@{strictly 20.0.0}

  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

BU�LD FAILED in 13s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

    
   


在github上搜索后,通过以下编辑,应用程序现在正在运行,但当我尝试使用mlkit时,会遇到以下错误

编辑2

   dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation platform('com.google.firebase:firebase-bom:26.0.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.android.support:multidex:1.0.3'
    api 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
    implementation 'com.google.android.gms:play-services-vision:20.1.1'
    implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
    implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'
    implementation 'com.google.android.gms:play-services-vision-face-contour-internal:16.0.2'
}

应用程序出错

D/MediaScannerConnection( 8393): Scanned /storage/emulated/0/Android/data/com.example.temp_name/files/Pictures/e235923b-70f9-404a-aa0b-930333cceea96952909717190624838.jpg to null
I/flutter ( 8393): /storage/emulated/0/Android/data/com.example.temp_name/files/Pictures/scaled_e235923b-70f9-404a-aa0b-930333cceea96952909717190624838.jpg
W/DynamiteModule( 8393): Local module descriptor class for com.google.android.gms.vision.dynamite.ica not found.
I/DynamiteModule( 8393): Considering local module com.google.android.gms.vision.dynamite.ica:0 and remote module com.google.android.gms.vision.dynamite.ica:0
W/DynamiteModule( 8393): Local module descriptor class for com.google.android.gms.vision.ica not found.
I/DynamiteModule( 8393): Considering local module com.google.android.gms.vision.ica:0 and remote module com.google.android.gms.vision.ica:0
E/Vision  ( 8393): Error loading optional module com.google.android.gms.vision.ica: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
W/LabelerNativeHandle( 8393): Native handle not yet available. Reverting to no-op handle.

请在 Stack Overflow 上不要展示文字和代码的图片。将文本复制到问题本身中,并进行格式化,以便易于阅读、复制和搜索。您可以使用底部的编辑链接编辑问题以进行更正。 - Doug Stevenson
我本来想把错误作为代码发送,但是出现了“您的问题中有太多代码”的错误。 - Emir Kutlugün
我不明白firebase-ml-vision@20.0.0的依赖关系是从哪里来的,因为firebase-bom:26.2.0只应该包含firebase-ml-vision@24.1.0 - Frank van Puffelen
请问您能否检查一下新的编辑? - Emir Kutlugün
1个回答

1

由于您包含了firebase-bom:26.2.0,这决定了您使用的所有Firebase SDK版本。因此,请从您的build.gradle中删除所有其他Firebase SDK依赖项的版本号以消除版本冲突。


谢谢您的回答,但我仍然遇到相同的错误。 - Emir Kutlugün
请编辑您的问题,展示新的 build.gradle 文件和精确的新错误信息(最好是文本形式,因为发布文本内容的截图会导致信息丢失)。 - Frank van Puffelen
使用编辑后的文本,但由于错误“太多代码”,无法像代码一样格式化它,希望它仍然比图像更有用。 - Emir Kutlugün

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接