Error:Execution failed for task ':app:processDebugGoogleServices'. > Please fix the version conflict

后端 未结 13 2583
生来不讨喜
生来不讨喜 2021-02-19 01:26

After updating my google play services to rev 28 i\'m getting this error. Im not sure why this is happening as it was working fine before.

here is my build.gradl

相关标签:
13条回答
  • 2021-02-19 01:57

    To resolve this error, go to the Project-->platform..>android-->.gradlefile and modify the line

    buildscript {
        repositories {
                jcenter()
                mavenLocal()
            }
        dependencies {
            classpath 'com.android.tools.build:gradle:+'
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    // 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
    
    0 讨论(0)
  • 2021-02-19 01:57

    I met this problem, too. What you say is not the key.

    dependencies {
    compile 'com.google.android.gms:play-services-auth:11.6.2'
    compile 'com.google.android.gms:play-services-plus:11.6.2'
    }
    apply plugin: 'com.google.gms.google-services'
    

    This apply plugin: 'com.google.gms.google-services' must at dependencies!

    0 讨论(0)
  • 2021-02-19 02:01

    change your google-services in Project dependencies to

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

    This will fix it.

    0 讨论(0)
  • 2021-02-19 02:03

    What solved it for me is to get latest version of google services from below link. Just needed to use latest version for classpath 'com.google.gms:google-services:2.0.0-beta4'

    https://bintray.com/android/android-tools/com.google.gms.google-services/

    0 讨论(0)
  • 2021-02-19 02:06
    • I copied the google-services.json file i downloaded and pasted it in app root folder i.e in your android studio,

    • Please also make sure the 'google-services.json' file you downloaded has the same name with the one you pasted in the root directory.

    This worked for me. thanks

    0 讨论(0)
  • 2021-02-19 02:07

    I too had the same problem when i was a newbie to Android Development. Though you had everything in place like below

    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    

    and you might be placed even the below line in your build.gradle(app level)

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

    placing the above piece of code at the bottom of your build.gradle file fix your error

    More important thing check your build.gradle(project level) file

    apply plugin:  dependencies {
            classpath 'com.android.tools.build:gradle:2.2.3'
            classpath 'com.google.gms:google-services:3.0.0'
        }'
    

    com.google.gms:google-services:3.0.0 is placed or not .it won't support old verisons

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