0

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.

3 Answers3

2

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

Faiizii Awan
  • 1,615
  • 1
  • 13
  • 28
  • I've tried that, the problem is that the interpreter don't have the 11.4.2 version and not all the others have 16.2.0 version. – Roman Rozenshtein Aug 25 '18 at 19:19
  • ok this is in app level gradle go to project level gradle and update gsm version to latest one and update all the dependency in app level graddle too this is the one way or you should try all the previous version of fireabse-ml-model version one by one by downgrading and see what version suitable to your current graddle – Faiizii Awan Aug 25 '18 at 19:27
  • this error is arising because you are trying to use ml-model-interpreter latest version which is compatible with gsm version 4 i think (which is latest version too) – Faiizii Awan Aug 25 '18 at 19:29
  • i made an update to my answer please check and let me know if it helps? – Faiizii Awan Aug 25 '18 at 20:15
  • Thanks, I will check this out and will get back to you. – Roman Rozenshtein Aug 25 '18 at 20:25
  • What did the trick is to update the gms services to the latest (4.0.1) and update all the Google and Firebase, including the interpreter libs to the latest. Update your answer and I will accept it, thanks for your assistance! – Roman Rozenshtein Aug 26 '18 at 09:38
1

For Firebase dependencies:

  1. Always check "Getting Started" guide for SDK / plugin versions: https://firebase.google.com/docs/android/setup Latest google-services plugin version as of Aug 2018 is 4.0.1

  2. Starting from May 2018, Google Play services and Firebase Android SDKs started to adopt a new versioning system complied to semantic versioning. After you upgrade all relevant SDKs to 15.0.0+ (check out each API's documentation), you no longer need to use identical versioning for each API moving forward. See below blog post for details (but ignore the specific versions in the post since they are no longer latest. Refer to Firebase documentation for latest versioning): http://www.googblogs.com/announcing-new-sdk-versioning-in-google-play-services-and-firebase/

Also, Firebase SDK versions: https://firebase.google.com/support/release-notes/android

Isabella Chen
  • 2,421
  • 13
  • 25
  • Thanks, I will follow these guidelines. – Roman Rozenshtein Aug 28 '18 at 18:31
  • Thanks again!I It seems that you are a professional in the subject, if you will have a moment to look at another question of mine, it would be great: https://stackoverflow.com/questions/52121533/what-is-the-difference-between-the-lite-and-the-tflite-formats – Roman Rozenshtein Aug 31 '18 at 20:02
0

Ref : https://firebase.google.com/docs/ml-kit/android/use-custom-models

As last answer update gradle
once again check official site documentation

Use a TensorFlow Lite model for inference with ML Kit on Android You can use ML Kit to perform on-device inference with a TensorFlow Lite model.

This API requires Android SDK level 16 (Jelly Bean) or newer.

See the ML Kit quickstart sample on GitHub for an example of this API in use, or try the codelab.

Before you begin If you have not already added Firebase to your app, do so by following the steps in the getting started guide. Include the dependencies for ML Kit in your app-level build.gradle file:

dependencies {
  // ...

  implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.0'
}

Convert the TensorFlow model you want to use to TensorFlow Lite (tflite) format. See TOCO: TensorFlow Lite Optimizing Converter.

Host or bundle your model Before you can use a TensorFlow Lite model for inference in your app, you must make the model available to ML Kit. ML Kit can use TensorFlow Lite models hosted remotely using Firebase, stored locally on the device, or both.

By both hosting the model on Firebase and storing the model locally, you can ensure that the most recent version of the model is used when it is available, but your app's ML features still work when the Firebase-hosted model isn't available.

Model security Regardless of how you make your TensorFlow Lite models available to ML Kit, ML Kit stores them in the standard serialized protobuf format in local storage.

In theory, this means that anybody can copy your model. However, in practice, most models are so application-specific and obfuscated by optimizations that the risk is similar to that of competitors disassembling and reusing your code. Nevertheless, you should be aware of this risk before you use a custom model in your app.

On Android API level 21 (Lollipop) and newer, the model is downloaded to a directory that is excluded from automatic backup.

On Android API level 20 and older, the model is downloaded to a directory named com.google.firebase.ml.custom.models in app-private internal storage. If you enabled file backup using BackupAgent, you might choose to exclude this directory.

For More Details Please Check https://firebase.google.com/docs/ml-kit/android/use-custom-models

Ashvin solanki
  • 4,802
  • 3
  • 25
  • 65