gpt4 book ai didi

java - 构建 apk 时出错 'libraries must use the exact same version specification'

转载 作者:行者123 更新时间:2023-12-01 16:50:24 25 4
gpt4 key购买 nike

dependencies {
...
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.github.AndroidDeveloperLB:MaterialPreferenceLibrary:5'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.onesignal:OneSignal:2.+@aar'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'
}

错误:

All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 8.3.0, 8.1.0. Examples include com.google.android.gms:play-services-ads:8.3.0 and com.google.android.gms:play-services:8.1.0

最佳答案

错误非常明显:您使用的是两个不同版本的 Google 服务。

这是 8.3.0:

compile 'com.google.android.gms:play-services-ads:8.3.0'

这些是 8.1.0:

compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'

将它们设置为相同的版本,这样就可以工作了。

请注意,8.1.0 和 8.3.0 都已经很旧了;将光标放在每一行上,单击 Alt+Enter,Android Studio 会建议您最新版本: Example

关于java - 构建 apk 时出错 'libraries must use the exact same version specification',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41229700/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com