我已经在sdk工具中安装了play服务,并添加了以下libs,尽管它显示了问题

   compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.firebase:geofire-android:2.1.1'
    compile 'com.google.gms.google-services:15.0.1'
    compile 'com.google.android.gms:play-services-maps:15.0.1'
    compile 'com.google.android.gms:play-services-drive:15.0.1'
    compile 'com.github.bumptech.glide:glide:4.0.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.github.jd-alexander:library:1.1.0'

    compile 'com.paypal.sdk:paypal-android-sdk:2.15.3'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

最佳答案

从依赖项中移除com.google.gms.google-services:15.0.1,这是一个gradle文件插件,而不是依赖项。

def mySupportVersion = "26.1.0"

dependencies {
    compile "com.android.support:appcompat-v7:$mySupportVersion"
    compile "com.android.support:design:$mySupportVersion"
    compile "com.android.support:cardview-v7:$mySupportVersion"
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.firebase:geofire-android:2.1.1'
    compile "com.google.android.gms:play-services-maps:15.0.1"
    compile "com.google.android.gms:play-services-drive:15.0.1"
    compile 'com.github.bumptech.glide:glide:4.0.0'
    compile 'com.github.jd-alexander:library:1.1.0'
    compile 'com.paypal.sdk:paypal-android-sdk:2.15.3'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

更改版本时,应使用def以获得灵活性。

10-08 03:15