Can't add gms play services 9.0.1, google-services plugin wants 9.0.0

前端 未结 3 1551
梦毁少年i
梦毁少年i 2021-02-18 18:08

I have this in my top-level build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath \'com.google.gms:google-s         


        
3条回答
  •  生来不讨喜
    2021-02-18 18:39

    That's because you should always put the "apply plugin" clause at the bottom for google-services, since it looks for the already-added dependencies. Do it like this in your app-level gradle:

    dependencies {
        compile 'com.google.android.gms:play-services-ads:9.0.1'
    }
    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'
    

    This is hidden in the Firebase documentation, but applies even if you don't use Firebase.

    Note : Update Google Repository also.

提交回复
热议问题