Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio

前端 未结 20 943
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 04:12

I am integrating OAuth login for Google+ on my android application, following the tutorial.

According to the tutorial, I should add the Google Service plugin by addi

相关标签:
20条回答
  • 2020-12-03 04:41

    Google updated their guide. Where it was classpath 'com.google.gms:google-services:1.0' now reads classpath 'com.google.gms:google-services:1.3.0-beta1' like joluet suggested.

    enter image description here

    0 讨论(0)
  • 2020-12-03 04:41

    I would advise you against doing what you are doing. I did it too (by following Set up a GCM Client App on Android blindly) but ended up with exceeding 65K method limit.

    So, you should remove the following lines from your gradle:

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

    Now import APIs of Google Plus with simple gradle import:

    compile 'com.google.android.gms:play-services-plus:8.1.0'
    
    0 讨论(0)
  • 2020-12-03 04:43

    Inside the .idea folder exists a workspace.xml file that defines the project's structure. I suggest you to close Android Studio, then delete .idea folder and then import the project again. The .idea would be generated by the IDE again. For me this solution works.

    0 讨论(0)
  • 2020-12-03 04:44

    I ran into the same issue today. In the samples they use this line instead: classpath 'com.google.gms:google-services:1.3.0-beta1' This works.

    0 讨论(0)
  • 2020-12-03 04:44

    As of 25th Nov,2015, google released a newer version.

    Try adding: classpath 'com.google.gms:google-services:2.0.0-alpha1'

    And don't forget to add jcenter() repository under buildscript.

    Thanks.

    0 讨论(0)
  • 2020-12-03 04:45

    Adding jcenter repository to project level build.gradle helped in my case:

    buildscript {
        repositories {
            jcenter();
            mavenCentral()
        }
    
    0 讨论(0)
提交回复
热议问题