android - 任务 ':app:proccessDebugGoogleServices' 执行失败

标签 android android-studio firebase gradle firebase-analytics

我正在尝试将我的应用与 Firebase 分析相关联。 我在 Gradle 任务时遇到问题:[:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]

我已经按照以下指南将 implement 'com.google.firebase:firebase-core:11.6.0' 放入 build.gradle 中。

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-core:11.6.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.google.android.gms:play-services-ads:11.4.2'
}


apply plugin: 'com.google.gms.google-services'

gradle 构建完成,出现 1 个错误

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 11.6.0.

有人能帮帮我吗?提前谢谢你。

最佳答案

要解决这个问题,你需要添加这行代码:

classpath 'com.google.gms:google-services:3.1.1'

build.gradle(项目)文件中的 dependencies 中。

同时更改这行代码:

implementation 'com.google.android.gms:play-services-ads:11.4.2'

implementation 'com.google.android.gms:play-services-ads:11.6.0'

关于android - 任务 ':app:proccessDebugGoogleServices' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47157744/

相关文章:

firebase - ID Token 与 uid 的用法?

javascript - firebase 云函数不会存储名为 "__session"以外的 cookie

java - 解析使用对象: Doesn't display even though record exists创建表

android - 如何在 Android 5.0 + 中获取 Top Activity

java - 尝试添加库后出错

java - 为什么我不能生成签名的 APK?

android - Firebase:查询使用push()创建的数据列表

android - 与工具栏、多屏布局等相关

由于 firebase-storage :11. 0.2 依赖性,Android 应用程序构建失败

android - Gradle 同步 : Failed to resolve (library name)