Firebase-android-sdk: firebase-ml-vision 24.1.0 isn't compatible with google-service plugin: 4.3.3

Created on 21 Aug 2020  ·  11Comments  ·  Source: firebase/firebase-android-sdk

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in __the code in this repository__.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

When I use the latest version of firebase-ml-vision which is 24.1.0, the google service plugin (com.google.gms:google-services:4.3.3) isn't compatible with it. It display some error in gradle console such as

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.

Relevant Code:

in root build.gradle

dependencies {
          ...
        classpath "com.google.gms:google-services:4.3.3"
    }

in app/build.gradle

dependencies {
          ...
     implementation "com.google.firebase:firebase-ml-vision:24.1.0"
    }

The error stacktrace is below:

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 onto com.google.android.gms:play-services-vision-face-contour-internal@{strictly 16.0.0}
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.0}
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision-face-model@{strictly 20.0.2}
-- 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.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 = false }" to your b
uild.gradle file.

FYI

Even if did the googleServices { disableVersionCheck = false } to ignore the version check, the project still won't be compiled.

mlkit needs-info

Most helpful comment

@underwindfall Try adding the following dependency

implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'

All 11 comments

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

Also experiencing this, any workaround??

I have encountered the same issue with implementation 'com.google.firebase:firebase-ml-vision:17.0.0'.

Try adding this in dependencies it worked for me:

implementation 'com.google.android.gms:play-services-vision:20.1.1'
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'

https://firebase.google.com/support/release-notes/android#bom_v25-8-0

I have the same issue. Only working with:

//Vision
implementation 'com.google.android.gms:play-services-vision:20.0.0'

// ML Kit dependencies
implementation 'com.google.firebase:firebase-ml-vision:24.0.3'
implementation 'com.google.firebase:firebase-ml-vision-barcode-model:16.1.1'

And Google Play Services version:

classpath 'com.google.gms:google-services:4.3.3'

Hi @underwindfall the latest release of ml-related SDKs have some known issues with their dependencies. Take a look at https://firebase.google.com/support/release-notes/android#mlkit-self-serve-fixes for workarounds. Do they fix your issue?

@rlazo Thx for the response, however still doesn't work. Do you have any ideas why cause this issue ?
here is my latest implementation

dependencies{
......
    implementation 'com.google.android.gms:play-services-vision:20.1.1'
    implementation "com.google.android.gms:play-services-vision-common:19.1.1"
    implementation "com.google.android.gms:play-services-vision-face-contour-internal:16.0.2"
    implementation "com.google.firebase:firebase-ml-vision:24.1.0"
    implementation "com.google.firebase:firebase-ml-vision-face-model:20.0.2"
}

and the stacktrace associated it:

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[19.1.
0]", 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-image-label:18.0.4 -> com.google.android.gms:play-servic
es-vision-common@[19.1.0], but play-services-vision-common version was 19.1.1.

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 onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.1}
-- Project 'app' depends onto com.google.android.gms:play-services-vision-face-contour-internal@{strictly 16.0.2}
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision-face-model@{strictly 20.0.2}
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- 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.android.gms:play-services-vision@{strictly 20.1.1}

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 = false }" to your b
uild.gradle file.

@underwindfall Try adding the following dependency

implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'

Result

@rlazo Thx for sharing this information. Finally the project can compile like a charm.

I write all the consequences and necessary steps as below for anyone occurs the same issue like me.

Consequence after upgrade latest version

However all the methods to do the face detection work I try to use such as

FirebaseVisionFaceDetectorOptions.Builder()
            .setPerformanceMode(FirebaseVisionFaceDetectorOptions.ACCURATE)
            .setLandmarkMode(FirebaseVisionFaceDetectorOptions.ALL_LANDMARKS)
            .setClassificationMode(FirebaseVisionFaceDetectorOptions.ALL_CLASSIFICATIONS)

are marked as Deprecated.

The reason why

The reason this firebase lib deprecated I think is the screenshot below (where I found here)

image

What need to do the migration

Just follow the doc ML KIT.

Great summary @underwindfall !! Thanks for going the extra mile and add it to the issue.

The library version sometimes makes my head lid open.
I think about the version every time, what is a good way,
I have a lot of work, so I will look for it next time😫

I was searching to add TensorFlow from existing face recognition
I searched far and came this far.

And the method I solved is below

implementation 'com.google.android.gms:play-services-vision:20.1.1'
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
implementation "com.google.android.gms:play-services-vision-face-contour-internal:16.0.2"
implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'
implementation 'com.google.firebase:firebase-ml-vision:24.1.0'
implementation 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.4'
implementation 'org.tensorflow:tensorflow-lite:2.0.0'

Was this page helpful?
0 / 5 - 0 ratings