#android #firebase #flutter #flutter-dependencies #firebase-mlkit
#Android #firebase #флаттер #флаттер-зависимости #firebase-mlkit
Вопрос:
Я пытаюсь использовать firebase_ml_vision 0.10.0; однако, когда я добавляю эту зависимость в android / app / build.gradle
Зависимость, которую я использую, — ‘com.google.firebase: firebase-ml-vision-image-label-model:17.0.2’ <- Эта зависимость выдает ошибку зависимости
android {
dependencies {
implementation platform('com.google.firebase:firebase-bom:26.4.0')
implementation 'com.google.firebase:firebase-analytics'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.firebase:firebase-ml-vision:24.0.1'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-vision-common:19.1.3'
implementation 'com.google.android.gms:play-services-vision-image-label:18.1.1'
//BOTTOM LINE DEPENDENCY ADDED
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2' <-- THIS LINE ADDED
}
}
Я получаю исключение сборки с указанием:
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. "[17.0.
2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-ml-vision-image-label-model:17.0.2 -> com.google.android.gms:play-servi
ces-vision-common@[17.0.2], but play-services-vision-common version was 19.1.3.
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.android.gms:play-services-vision@{strictly 20.1.3}
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision-image-label-model@17.0.2
-- Project 'app' depends onto com.google.firebase:firebase-bom@{strictly 26.4.0}
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision@18.0.1
-- Project 'app' depends onto com.google.firebase:firebase-bom@26.4.0
-- 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-image-label@{strictly 18.1.1}
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision-image-label-model@{strictly 17.0.2}
-- Project 'app' depends onto com.google.android.gms:play-services-vision@20.1.3
-- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@18.1.1
-- Project 'app' depends onto com.google.android.gms:play-services-vision-common@19.1.3
-- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.3}
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
BUILD FAILED in 26s
Exception: Gradle task assembleDebug failed with exit code 1
Что мне нужно сделать, чтобы исправить эту ошибку, связанную с зависимостью? Спасибо.
Комментарии:
1. Привет, согласно документации: «включите последний соответствующий комплект ML: зависимость от маркировки изображений в свой файл build.gradle на уровне приложения». Не могли бы вы попробовать с помощью com.google. firebase: firebase-ml-vision-image-label-model: 20.0.2 какая текущая версия?