1

I was following the official Google authentication process. My app has been already using the latest version of Google Maps.

project

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:3.1.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

app

apply plugin: 'com.google.gms.google-services'
....
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'

There is a red line under maps and the popup says that it found 11.8.0 and 11.4.2. The build error message is something like,

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.

If I comment out apply plugin: 'com.google.gms.google-services', the build error disappears, but the official document tells me to add it.

How can I fix this?

Community
  • 1
  • 1
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135
  • Your project uses multiple versions of Google libraries. You can find using below command which library use which version Please run below command on Android terminal ./gradlew -q dependencies app:dependencies --configuration compile It will show current and latest of libraries which are used in your project. – Patrick R Jan 12 '18 at 09:45

1 Answers1

1

Add the following line in the dependencies of the project-level build.gradle:

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

For a full working example, check out the following project on github.

Check ':app:processDebugGoogleServices' , Android Studio Gradle: Error:Execution failed for task ':app:processDebugGoogleServices'.

Hope this may help you.

Janmejoy
  • 2,721
  • 1
  • 20
  • 38