Android 颤振:将firebase_ml_视觉依赖项从0.9.x升级到0.10.0
我的颤振项目在Firebase ML Vision 0.9.x上运行良好,如果我尝试升级到0.10.0(或更高版本),它会产生以下错误:Android 颤振:将firebase_ml_视觉依赖项从0.9.x升级到0.10.0,android,flutter,build.gradle,firebase-machine-learning,Android,Flutter,Build.gradle,Firebase Machine Learning,我的颤振项目在Firebase ML Vision 0.9.x上运行良好,如果我尝试升级到0.10.0(或更高版本),它会产生以下错误: FAILURE: Build completed with 2 failures. 1: Task failed with an exception. ----------- * Where: Build file 'C:\Users\...\Cache\hosted\pub.dartlang.org\firebase_ml_vision-0.10.0\an
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\...\Cache\hosted\pub.dartlang.org\firebase_ml_vision-0.10.0\android\build.gradle' line: 26
* What went wrong:
A problem occurred evaluating project ':firebase_ml_vision'.
> Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':firebase_ml_vision'.
> compileSdkVersion is not specified. Please add it to build.gradle
* 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 889ms
Exception: Gradle task assembleDebug failed with exit code 1
这两个错误中的第一个很奇怪,因为和都表示不再需要firebase\u core
第二个是完全错误的,因为我的应用程序的build.gradle指定了compileSdkVersion 30
,而firebase\u ml\u vision包的build.gradle指定了compileSdkVersion 29
有什么想法吗?找到了一个有效的解决方案: 忽略设置说明并添加
firebase_core
作为依赖项。然后,根据添加“实现”,以解决“重复类”问题