gpt4 book ai didi

android - 将 gradle 依赖项 9.4.0 更新为 9.6.1 时生成错误

转载 作者:搜寻专家 更新时间:2023-11-01 07:48:07 26 4
gpt4 key购买 nike

大家好,我刚刚更新了我的 gradale 依赖项,但是当我构建我的项目时它没有构建。

这里是grandel控制台的错误代码

:app:processDebugGoogleServicesFound com.google.android.gms:play-services-ads:9.6.1, but version 9.4.0 is needed for the google-services plugin.Found com.google.android.gms:play-services:9.6.1, but version 9.4.0 is needed for the google-services plugin.Found com.google.android.gms:play-services-gcm:9.6.1, but version 9.4.0 is needed for the google-services plugin.Found com.google.android.gms:play-services-analytics:9.6.1, but version 9.4.0 is needed for the google-services plugin.Found com.google.android.gms:play-services-location:9.6.1, but version 9.4.0 is needed for the google-services plugin.:app:processDebugGoogleServices FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:processDebugGoogleServices'.> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.4.0.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.BUILD FAILED

这是我的应用级构建等级看起来像

...    dependencies {        compile fileTree(include: ['*.jar'], dir: 'libs')        testCompile 'junit:junit:4.12'        compile 'com.android.support:appcompat-v7:24.2.1'        compile files('libs/commons-codec-1.10.jar')        compile 'com.onesignal:OneSignal:3.0.3@aar'        compile 'com.google.firebase:firebase-ads:9.4.0'        compile 'com.google.firebase:firebase-database:9.4.0'        compile 'com.google.android.gms:play-services-ads:9.6.1'        compile 'com.google.android.gms:play-services:9.6.1'        compile 'com.google.android.gms:play-services-gcm:9.6.1'        compile 'com.google.android.gms:play-services-analytics:9.6.1'        compile 'com.google.android.gms:play-services-location:9.6.1'        compile('com.crashlytics.sdk.android:crashlytics:2.6.3@aar') {            transitive = true;        }    }    apply plugin: 'com.google.gms.google-services'

我所有的谷歌存储库都是最新的。SDK 管理器中没有显示要更新的内容。

如何解决这个问题

谢谢。

最佳答案

您混合使用了不同版本的 Firebase 和 Google Play 服务。不要。

ext.googlePlayVersion = "9.6.1"
compile "com.google.firebase:firebase-ads:$googlePlayVersion"
compile "com.google.firebase:firebase-database:$googlePlayVersion"
compile "com.google.android.gms:play-services-ads:$googlePlayVersion"
compile "com.google.android.gms:play-services:$googlePlayVersion"
compile "com.google.android.gms:play-services-gcm:$googlePlayVersion"
compile "com.google.android.gms:play-services-analytics:$googlePlayVersion"
compile "com.google.android.gms:play-services-location:$googlePlayVersion"

注意:双引号是强制性的,否则变量将按字面意思。


确保您使用的是最新的 Google 服务插件,截至 9 月 26 日,它是 3.0.0。检查您的项目 build.gradle

dependencies {
classpath 'com.google.gms:google-services:3.0.0'
}

关于android - 将 gradle 依赖项 9.4.0 更新为 9.6.1 时生成错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39710405/

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