微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Firebase 机器学习套件

如何解决Firebase 机器学习套件

尝试使用 Firebase ml 套件作为标签,但在版本下方出现错误; 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.

解决方法

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。