Arun
Arun

Reputation: 73

Build Failed on integrating firebase_ml_vision 0.9.10 in flutter

Here is the same question. The answer doesn't work for me and I can't add comment because of my less reputation. Hence asking the question again.

The error thrown was:

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. "[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 art
  ifact 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:[email protected].
  0
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.0}
  -- Project 'app' depends onto com.google.firebase:[email protected]
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@{strictly 18.0.4}
  -- Project 'app' depends onto com.google.firebase:firebase-bom@{strictly 26.1.1}
  -- Project 'app' depends onto com.google.android.gms:play-services-vision@{strictly 20.0.0}

  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 3s
Exception: Gradle task assembleDebug failed with exit code 1

Here is my android level build.gradle


    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.4'
    }

Here is my app level build.gradle


dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    api 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.2'
    api 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
    implementation platform('com.google.firebase:firebase-bom:26.1.1')  
}

apply plugin: 'com.google.gms.google-services'

I have also tried removing these two lines. api 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.2' api 'com.google.firebase:firebase-ml-vision-face-model:20.0.2' because these are deprecated now.

In my AndroidManifest.xml, I have added this:

<meta-data
            android:name="com.google.firebase.ml.vision.DEPENDENCIES"
            android:value="barcode,face,label,ocr" />

How do I solve this issue? I am stuck with this for several days now.

Upvotes: 0

Views: 1292

Answers (1)

Nandan Wewhare
Nandan Wewhare

Reputation: 525

Check out this reply on the issue in official Github repo: https://github.com/FirebaseExtended/flutterfire/issues/3995#issuecomment-723401583

Also, this issue is a duplicate here:
https://github.com/FirebaseExtended/flutterfire/issues/3995

I think this will work for you.

Upvotes: 1

Related Questions