Flutter firebase_ml_vision build failed with exception

主宰稳场 提交于 2021-01-29 07:41:04

问题


Android build keeps crashing with firebase_ml_vision being the dependency that causes it.

Below is the output from the debug console when running a build for android.

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

回答1:


Go into your android/app/build.gradle file.

At the bottom, you should have a dependencies object. Remove the concrete version from firebase-bom below.

Before:

dependencies {
    implementation platform('com.google.firebase:firebase-bom:25.12.0')
    ...
}

After:

dependencies {
    implementation platform('com.google.firebase:firebase-bom')
    ...
}


来源:https://stackoverflow.com/questions/64293457/flutter-firebase-ml-vision-build-failed-with-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!