Error compiling com.google.gms: play-services-ads: 9.2.0

6

Updating the dependencies in android studio I find the following 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.0.0.

Previously I had the dependencies in the following way.

apply plugin: 'com.android.application'


android {
     compileSdkVersion 24
     abuildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.android.myapp"
    minSdkVersion 15
    targetSdkVersion 24
    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:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.android.support:support-v4:24.0.0'
    compile 'com.android.support:cardview-v7:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.android.support:palette-v7:24.0.0'
    compile 'com.android.support:mediarouter-v7:24.0.0'

    compile 'com.google.firebase:firebase-ads:9.0.0'
    compile 'com.google.firebase:firebase-crash:9.0.0'
    compile 'com.google.firebase:firebase-analytics:9.0.0'

    compile 'com.google.android.gms:play-services-ads:9.0.0'

}

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

The error I get when changing the line

compile 'com.google.android.gms:play-services-ads:9.0.0'

a

compile 'com.google.android.gms:play-services-ads:9.2.0'
    
asked by Pelayo Rodriguez 28.06.2016 в 00:37
source

3 answers

0

Fixed, you had to update also the firebase plugins to version 9.2.0

compile 'com.google.firebase:firebase-ads:9.2.0'
compile 'com.google.firebase:firebase-crash:9.2.0'
compile 'com.google.firebase:firebase-analytics:9.2.0'
    
answered by 29.06.2016 / 17:36
source
2

Check that you have not activated the option "Offline work" of Gradle, that may be a reason why you are not downloading the support, I see that the version if exists . This is the sequence to access from the menu:

File > Settings > Build, Execution, Deployment > Build tools > Gradle

Synchronize your project with the Gradle files!

Be sure to update the latest version of Google Play Services and Google Repository so you can support the latest version of play-services-ads:9.2.0

    
answered by 28.06.2016 в 00:51
2

In the Gradle file of your project you have

dependencies {
    classpath 'com.google.gms:google-services:3.0.0'
}

That's the latest version of the plugin today. Until you update the plugin to support version 9.2.0, you will have to return to version 9.0.2

    
answered by 28.06.2016 в 16:34