0

Execution failed for task ':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 9.0.0.

4 Answers4

1

In case of Cordova OR Ionic App

I have the similar problem with my ionic 1 cordova build after Integrating the Firebase Cloud Messaging ( FCM )

Error Message

  • What went wrong: Execution failed for task ':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 9.0.0.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.605 secs Error: /Users/beo-administrator/Documents/projects/Apps/Ionic/psc/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

Solution

I fixed this issue by the following steps

So one fix will be: inside platforms/android open project.properties (Its a file ) , you will have something like this

cordova.system.library.1=com.google.android.gms:play-services-ads:+
cordova.system.library.2=com.google.firebase:firebase-core:+
cordova.system.library.3=com.google.firebase:firebase-messaging:+

Replace the

+

Sign with your target version number - like the following

cordova.system.library.1=com.google.android.gms:play-services-ads:9.0.0
cordova.system.library.2=com.google.firebase:firebase-core:9.0.0
cordova.system.library.3=com.google.firebase:firebase-messaging:9.0.0

Save the file

Then take build using

 ionic cordova run android
sijo vijayan
  • 1,590
  • 1
  • 21
  • 34
0

Go to platforms > android > cordova-plugin-fcm. Find file that look like something-FCMPlugin.gradle.

Then change to:

buildscript {
    repositories {
            jcenter()
            mavenLocal()
        }
    dependencies {
        classpath 'com.android.tools.build:gradle:+'
        classpath 'com.google.gms:google-services:3.0.0' // change this line
    }
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

source: https://stackoverflow.com/a/44039853/8037833

Community
  • 1
  • 1
A RD
  • 1
  • 2
0
Go to platforms > android > android build.gradle and add below three lines in  dependencies area
 compile "com.google.firebase:firebase-core:9.0.0"
 compile "com.google.firebase:firebase-messaging:9.0.0"
 compile "com.google.android.gms:play-services-gcm:9.0.0"

 Now your update dependencies looks like as-

dependencies {
    compile fileTree(include: '*.jar', dir: 'libs')
    // SUB-PROJECT DEPENDENCIES START
    debugCompile project(path: 'CordovaLib', configuration: 'debug')
    releaseCompile project(path: 'CordovaLib', configuration: 'release')
    compile 'com.android.support:support-v4:23.4.0'
    compile 'com.facebook.android:facebook-android-sdk:4.14.+'
//  compile 'com.google.firebase:firebase-core:+'
//  compile 'com.google.firebase:firebase-messaging:+'
    // SUB-PROJECT DEPENDENCIES END
    compile files('libs/twitter4j-core-4.0.2.jar')
    compile 'com.google.code.gson:gson:2.8.0'
    compile "com.google.firebase:firebase-core:9.0.0"
    compile "com.google.firebase:firebase-messaging:9.0.0"
    compile "com.google.android.gms:play-services-gcm:9.0.0"
}
0

Had the same problem and the other answers didn't work for me.(as on build the build.gradle get's edited and the version nr return to the previous nr.)

I've fixed it by editing the project.properties file in platforms/android/

target=android-25
android.library.reference.1=CordovaLib
cordova.gradle.include.1=com-sarriaroman-photoviewer/starter-photoviewer.gradle
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.system.library.2=com.android.support:support-v13:25.1.0
cordova.system.library.3=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.4=com.google.firebase:firebase-messaging:11.0.1
cordova.gradle.include.2=phonegap-plugin-push/starter-push.gradle
cordova.system.library.5=com.google.android.gms:play-services-base:11.0.1
cordova.system.library.6=com.google.android.gms:play-services-ads:11.0.1

Make sure that there is the same version of com.google.android.gms

Cristian Tr
  • 716
  • 1
  • 7
  • 25