Google Play Services GCM 9.2.0 asks to “update” back to 9.0.0

前端 未结 11 1518
眼角桃花
眼角桃花 2020-12-07 11:35

So this morning I started updating to the latest version of my project libraries.

I\'m trying to update GCM to the latest version 9.2.0, but I get this error:

<
相关标签:
11条回答
  • 2020-12-07 12:22

    I didn't have an issue with this until I tried to use the Location Services, at which point I had to put the apply plugin: 'com.google.gms.google-services' at the bottom of the file, rather than the top. The reason being that when you have it at the top there are collision issues, and by placing it at the bottom, you avoid those issue.

    0 讨论(0)
  • 2020-12-07 12:23

    Gustavomcls's solution to change com.google.* version to same version worked for me .

    I change both dependancies to 9.2.1 in buid.gradle (Module:app)

    compile 'com.google.firebase:firebase-ads:9.2.1'
    compile 'com.google.android.gms:play-services:9.2.1'
    
    0 讨论(0)
  • 2020-12-07 12:25

    I had the same problem, today 2016 - october - 06 I solved with this:

    I changed all dependencies that began with 9.?.? to 9.6.1 I compiled with sdk version 24 and target version 17.

    There is another packages in my solution because I used more things then only authentication.

    After changed your build.gradle (Module:app) with the code below do it:

    1. Put your package NAME in the line with the words applicationId "com.YOUR_PACKAGE_HERE"

    2. Synchronize your project (Ctrl+alt+v) and Build Again.

    This is the code of the file buid.gradle (Module:app) that worked for me:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 24
        buildToolsVersion "24.0.3"
        defaultConfig {
            applicationId "com.YOUR_PACKAGE_HERE"
            minSdkVersion 24
            targetSdkVersion 17
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
    
        compile 'com.google.firebase:firebase-core:9.6.1'
        compile 'com.google.firebase:firebase-database:9.6.1'
    
        compile 'com.android.support:appcompat-v7:24.2.1'
        compile 'com.android.support:design:24.2.1'
    
        compile 'com.google.firebase:firebase-crash:9.6.1'
        testCompile 'junit:junit:4.12'
    
        compile 'com.google.firebase:firebase-messaging:9.6.1'
    
        compile 'com.google.firebase:firebase-ads:9.6.1'
    
    
        compile 'com.google.firebase:firebase-auth:9.6.1'
    
    
        compile 'com.google.android.gms:play-services:9.6.1'
    
    }
    apply plugin: 'com.google.gms.google-services'
    
    0 讨论(0)
  • 2020-12-07 12:35

    Do you have the line

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

    line at the bottom of your app's build.gradle file?

    I saw some errors when it was on the top and as it's written here, it should be at the bottom.

    0 讨论(0)
  • 2020-12-07 12:37

    Just put this line at the bottom of your app-module's (not project root's) gradle file.

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

    Then rebuild your project.

    0 讨论(0)
提交回复
热议问题