Ionic :app:processDebugGoogleServices (Version conflict)

I installed push plugin on ionic app and got this build fail

Found firebase-messaging:11.6.2, but version 11.0.4 is needed for the google-services plugin.
:app:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

* What went wrong:
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.0.4.

my build.gradle (module:app)

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    implementation(project(path: ":CordovaLib"))
    compile "com.facebook.android:facebook-android-sdk:4.+"
    compile "com.google.android.gms:play-services-base:11.0.4"
    compile "com.google.android.gms:play-services-ads:11.0.4"
    compile "com.android.support:support-v13:23+"
    compile "com.android.support:support-v13:27.+"
    compile "me.leolin:ShortcutBadger:1.1.17@aar"
    compile "com.google.firebase:firebase-messaging:11.6.2"
    // SUB-PROJECT DEPENDENCIES END
}
1 Like

change the version of firebase to 11.0.4

make the version of play-services as firebase

Change the setting inside the project.properties file.
Changing it in the build.gradle (module:app) does not help as this file gets overridden everytime you build your project.

I hope this helps someone else. :grinning:

1 Like

thank you @munyanyika you saved my day :smiley:

1 Like

Facing below issue:
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_dv6lzgluo19ykxjukiyadsxm9.run(/Users/sumeet/theVille/platforms/android/build.gradle:144)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

Cannot add task ‘:processDebugGoogleServices’ as a task with that name already exists.

ionic info is as below:
Ionic:

ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.4.2
@ionic/app-scripts : 3.2.3

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 6.4.0
Cordova Plugins : no whitelisted plugins (16 plugins total)

System:

NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave

let me know if any library or sdk version is needed

This is work for me.

1 Like