android - 无法解析 : com. google.gms.google-services :15. 0.1:

标签 android google-play-services

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

   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 以获得灵 active 。

关于android - 无法解析 : com. google.gms.google-services :15. 0.1:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50309559/

相关文章:

java - 实现 Google Play 游戏服务排行榜时缺少 BaseGameUtils\bin

android - DataSource.getAppPackageName() 在 Google Fit 中总是返回 "com.google.android.gms"

android - Gradle + Libgdx + GooglePlayService,它们不能和平共处吗?

Android 如何从 RelativeLayout 中删除 ImageView

Android:我必须将正在使用的库的许可证放在哪里?

java - List Array Shuffle 还是用头撞墙?

java - 自定义类变量被某些未知进程覆盖

java - 为什么 Android 的 onItemClick 需要 long for row Id?

android - Play 服务广告库 7.5.0 需要 WRITE_EXTERNAL_STORAGE 权限

Android Awareness API 多重围栏注册