Flutter firebase_ml_vision构建因异常而失败 [英] Flutter firebase_ml_vision build failed with exception

查看:47
本文介绍了Flutter firebase_ml_vision构建因异常而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android版本不断崩溃,而firebase_ml_vision是导致它的依赖项.

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

以下是运行android构建时调试控制台的输出.

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}

推荐答案

进入您的 android/app/build.gradle 文件.

在底部,您应该有一个 dependencies对象.从下面的firebase-bom中删除具体版本.

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

之前:

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

之后:

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

这篇关于Flutter firebase_ml_vision构建因异常而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆