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 1101
傲寒
傲寒 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:07

    I had the same issue while use OneSignal to handle push notifications in my android application.

    The solution is to add the exclude clause to its' dependency:

    implementation ('com.onesignal:OneSignal:3.8.3'){
        exclude group: 'com.google.android.gms'
    }
    

    in the app folder, then add any other missing dependency manually such as:

    implementation 'com.google.android.gms:play-services-appinvite:16.1.0'
    

    The problem is that OneSignal SDK contains Google Play Service dependency that are not of the same version with the latest version of gms and firesbase I used in the app.

    So I suggest you figure out a dependency you added that uses google play service in the project and use the exclude clause on it. Though your gradle should build if your system is connected to the internet.

    Hope this is helpful.

提交回复
热议问题