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 1013
傲寒
傲寒 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:19

    OPTION 1:

    Follow the below instruction to resolve it.

    Project-level build.gradle

    use

    maven { url "https://www.jitpack.io" }
    

    instead of

    maven { url "https://jitpack.io" }
    

    OPTION 2:

    Project-level build.gradle

    google() repository should be 1st priority

    allprojects {
        repositories {
            google()
            mavenLocal()
            jcenter()
        }
    }
    

    OPTION 3:

    Follow the below steps to resolve it.

    Step1:

    Project-level build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.google.gms:google-services:4.2.0' // google-services plugin
            classpath 'com.android.tools.build:gradle:3.4.2'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            maven { url "http://dl.bintray.com/populov/maven" }
            maven { url "https://jitpack.io" } // For Ucrop
            maven { url "https://maven.google.com" } // Google's Maven repository - FCM
            maven {
                url 'https://dl.bintray.com/azeesoft/maven'
            }
            google()
            jcenter()
            mavenCentral()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    Step2:

    App-level build.gradle

    I have update One Signal version.

    use

    implementation 'com.onesignal:OneSignal:3.11.1'
    

    instead of

    implementation 'com.onesignal:OneSignal:3.10.9' 
    

提交回复
热议问题