Search code examples
androidtensorflowgradleandroid-gradle-pluginfirebase-mlkit

Android: Getting Error:Execution failed for task ':app:processDebugGoogleServices' after adding a new dependency


Full error trace:

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.

The error happens when I am adding the last dependency:

compile 'com.google.firebase:firebase-ml-model-interpreter:16.2.0'

Here are my gradle dependencies:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.jakewharton:butterknife:8.6.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
    compile 'com.facebook.android:facebook-login:4.27.0'
    compile 'com.firebaseui:firebase-ui-database:2.0.1'
    compile 'com.firebaseui:firebase-ui-storage:2.0.1'
    compile 'com.firebase:firebase-jobdispatcher:0.6.0'
    compile 'com.google.firebase:firebase-core:11.4.2'
    compile 'com.google.firebase:firebase-auth:11.4.2'
    compile 'com.google.firebase:firebase-ads:11.4.2'
    compile 'com.google.firebase:firebase-database:11.4.2'
    compile 'com.google.firebase:firebase-storage:11.4.2'
    compile 'com.google.firebase:firebase-messaging:11.4.2'
    compile 'com.android.support:design:25.4.0'
    compile 'com.android.support:appcompat-v7:25.4.0'
    compile 'com.android.support:recyclerview-v7:25.4.0'
    compile 'com.android.support:cardview-v7:25.4.0'
    compile 'com.android.support:support-v4:25.4.0'
    implementation 'com.android.support:support-v4:25.4.0'
    implementation 'com.android.support:support-vector-drawable:25.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.github.chrisbanes:PhotoView:2.1.3'
    //network
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true
    }
    //billing
    compile 'com.anjlab.android.iab.v3:library:1.0.44'
    //tutorial
    compile 'com.github.popalay:tutors:1.0.6'
    //rate dialog
    compile 'io.github.kobakei:ratethisapp:1.2.0'
    compile 'com.github.tozny:java-aes-crypto:1.1.0'
    compile 'com.flurry.android:analytics:8.1.0'
    compile 'com.github.ceryle:RadioRealButton:v2.1.1'
    compile 'com.github.drawers:SpinnerDatePicker:1.0.6'
/*    compile 'com.siclo.ezphotopick:library:1.0.8'
    implementation project(':EZPhotoPickerLib')*/
    compile project(path: ':EZPhotoPickerLib')

    compile "commons-io:commons-io:2.6"

    compile "com.github.hotchemi:permissionsdispatcher:3.1.0"
    annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:3.1.0"

    compile 'org.tensorflow:tensorflow-lite:+'

    compile 'com.google.firebase:firebase-ml-model-interpreter:16.2.0'

}

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

Tried syncing the libs but I am constantly getting this error no matter what I do.


Solution

  • Go to your Project level build and replace

        classpath 'com.google.gms:google-services:3.x.x'
    

    with

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

    and sync your code because in your app gradle you are using mi-modal-interpreter lastes which have dependencies version which are compatible with gsm latest version. Whereas you are using an old version google.gsm which confuses the version conflict.

    if you update the google.gsm to 4.x.x then may be you have to update other all dependencies of google to latest versions. And you are also using firebase.ui:2.x.x On Updating these UI to firebase.ui:3.x.x then you need to change your code too because some of the methods is ui:2.x.x are also replace with new methods refernce