简体   繁体   English

Flutter:将 firebase_ml_vision 依赖项从 0.9.x 升级到 0.10.0

[英]Flutter: upgrading firebase_ml_vision dependency from 0.9.x to 0.10.0

My flutter project runs fine with Firebase ML Vision 0.9.x, if I try to upgrade to 0.10.0 (or higher), it yields the following errors:我的 flutter 项目在 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\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

The first of those two errors is weird because the setup instructions and the package install guidelines both say that firebase_core is not required (anymore).这两个错误中的第一个很奇怪,因为设置说明package 安装指南都说firebase_core不再需要。

The second is just plain wrong, as my app's build.gradle specifies compileSdkVersion 30 and the firebase_ml_vision package's build.gradle specifies compileSdkVersion 29 .第二个是完全错误的,因为我的应用程序的 build.gradle 指定compileSdkVersion 30和 firebase_ml_vision 包的 build.gradle 指定compileSdkVersion 29

Any ideas what's going on?有什么想法吗?

Found a solution that works: Ignore the setup instructions and add firebase_core as a dependency.找到一个可行的解决方案:忽略设置说明并将firebase_core添加为依赖项。 Then, add the 'implementations' according to this thread to solve the 'Duplicate class' issues.然后,根据此线程添加“实现”以解决“重复类”问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter firebase_ml_vision 构建失败,出现异常 - Flutter firebase_ml_vision build failed with exception 使用 Kotlin DSL 配置 Protocol Buffers 0.9.x - Configuring Protocol Buffers 0.9.x with Kotlin DSL 与 firebase ml 视觉相比,使用 Firebase ml 视觉条形码 model 获得更少的条形码值 - Getting less barcode values using Firebase ml vision barcode model compare to firebase ml vision 在 Compute/Isolate 函数中运行 Firebase ML Vision API 调用 - Running the Firebase ML Vision API calls inside a Compute/Isolate function Firebase Ml 套件、Google 云视觉 API 或 openCV - Firebase Ml kit, Google cloud vision API or openCV Google 的 Firebase ML Vision 仅适用于我的三星设备 - Google's Firebase ML Vision only works on my Samsung Devices 添加 firebase ML 视觉时,gradle 构建失败 - gradle build failed when adding firebase ML vision 将Firebase ML视觉依赖项与Firebase数据库依赖项添加时,Android应用程序崩溃 - android app crashes when adding firebase ML vision dependencies with firebase database dependencies 为什么 google_ml_kit flutter 库 [Google ML kit vision] 在构建 flutter ios / android 时占用了大尺寸? - why google_ml_kit flutter library [Google ML kit vision] took large size while taking flutter ios / android build? 如何为 Flutter 相机添加闪光灯切换按钮 (flutter_camera_ml_vision) - How to add flash toggle button to Flutter camera (flutter_camera_ml_vision)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM