java - Gradle 问题 - 错误 :Execution failed for task

标签 java android gradle

我收到此错误消息

Error: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/ ) 或将 com.google.android.gms 版本更新至 11.0.4。

我的等级

 apply plugin: 'com.android.application'
     android {
            compileSdkVersion 26
            defaultConfig {
                applicationId "com.books.mrwan.qasswanwadar"
                minSdkVersion 17
                targetSdkVersion 26
                versionCode 1
                versionName "1.0"
                testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
                vectorDrawables.useSupportLibrary = true
            }
            buildTypes {
                release {
                    minifyEnabled false
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
        }

        dependencies {
            implementation fileTree(dir: 'libs', include: ['*.jar'])

            implementation 'com.android.support:appcompat-v7:26.1.0'
            implementation 'com.android.support:design:26.1.0'
            implementation 'com.android.support.constraint:constraint-layout:1.1.0'
            implementation 'com.android.support:support-vector-drawable:26.1.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'
            compile 'com.google.firebase:firebase-database:11.4.2'
            compile 'com.google.firebase:firebase-core:11.4.2'
            compile 'com.google.firebase:firebase-ads:11.0.0'
            compile 'com.google.firebase:firebase-messaging:11.0.4'
            compile 'com.google.android.gms:play-services-maps:11.0.4'
            compile 'com.google.android.gms:play-services-location:11.0.4'
        }
        apply plugin: 'com.google.gms.google-services'

我做错了什么?

最佳答案

尝试改变这个词compileimplementation

并将google库的所有版本更改为15.0.0

示例:

implementation 'com.google.firebase:firebase-database:15.0.0'

应该可以工作。

关于java - Gradle 问题 - 错误 :Execution failed for task,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50239133/

相关文章:

android - 使用截击监听器时 Activity 泄漏

c++ - 如何使用 Gradle MSBuild 插件运行 SonarQube Scanner?

java - 如何为 GradleWorkerMain 设置 JVM 选项?

java - 如何计算以字符串形式给出的数学表达式?

java - jenkins,使用 jenkins 为项目生成 .jar

java - 通过 Intent 传递内部带有 arraylist 的对象

gradle - 使用Gradle打包来自Artifactory的多个 Artifactory

java - Spring 3 为 ThreadPoolTask​​Executor 设置 ThreadFactory

java - Camunda:如何将变量从父进程传递到子进程。 (由事件启动)

android - Android 中 RelativeLayout 问题中的 EditText