Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-basement:[15.0.0,16.0.0)

前端 未结 12 1011
傲寒
傲寒 2021-01-07 20:52

I am getting this error: Here is my build.gradle(Module:app)

apply plugin: \'com.android.application\'
apply plugin: \'io.fabric\'

android {
    compileSdkV         


        
相关标签:
12条回答
  • 2021-01-07 21:21

    If this problem occurred to you suddenly, it may be that it was corrupted while generating the apk. This rarely happens

    Solution: rebuild tasks

    you can see it in this image

    0 讨论(0)
  • 2021-01-07 21:21

    Have you tried adding this in your dependencies:

    implementation 'com.google.android.gms:play-services-basement:15.0.0'
    
    0 讨论(0)
  • 2021-01-07 21:25

    I was using a VPN for internet connection. I closed VPN and it worked for me.

    0 讨论(0)
  • 2021-01-07 21:25

    Just Build → Clean Project worked for me

    0 讨论(0)
  • 2021-01-07 21:27

    Using the VPN solved my problem.

    0 讨论(0)
  • 2021-01-07 21:29

    Open top-level build.gradle file and add google-services:

    buildscript {
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.6.3'
            classpath 'com.google.gms:google-services:4.3.3'
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    

    also if you already have it added simply update google-service and gradle to the latest

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