Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error build.gradle with com.google.android.gms:play-services-maps:9.4.0

In my app I have these dependencies:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.package_app.name"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.google.firebase:firebase-core:9.2.0'
    compile 'com.google.firebase:firebase-messaging:9.2.0'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:design:23.2.1'
    compile "com.android.support:recyclerview-v7:23.2.1"
    compile 'com.android.support:cardview-v7:23.2.1'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
}

Below these dependencise I put

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

But I can't build app because return this error.

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 9.2.0.

So I tried to put

compile 'com.google.android.gms:play-services-maps:9.2.0'

And the app build, so my question is: Why I can't use the last versione of services-map?

like image 798
LorenzoBerti Avatar asked Mar 01 '26 00:03

LorenzoBerti


2 Answers

Add this line to end of build.gradle

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

And add this classpath (other build.gradle)

classpath 'com.google.gms:google-services:3.0.0'
like image 134
Michele Lacorte Avatar answered Mar 03 '26 13:03

Michele Lacorte


I faced the same issue yesterday and solved it by doing the follows :

Firstly, make sure that you project/top level gradle file has the latest version for google services inside dependencies

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

Secondly, make sure to put the plugin at the bottom of the gradle app file

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

And make sure all google services dependencies including firebase are of the same version i.e. 9.4.0

compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'

compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'

This is what i currently have in my app.gradle dependencies.

like image 29
Gaurav Sarma Avatar answered Mar 03 '26 14:03

Gaurav Sarma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!