代码之家  ›  专栏  ›  技术社区  ›  Dpka

任务“:app:ProcessDebuggGoogleServices”的执行失败

  •  2
  • Dpka  · 技术社区  · 7 年前

    我有我的身材。gradle(应用程序)为:

    apply plugin: 'com.android.application'
    
    android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.dpka.myproject"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    }
    
    dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:support-v4:27.1.0'
    implementation 'com.google.firebase:firebase-database:12.0.1'
    implementation 'com.google.firebase:firebase-auth:12.0.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-core:12.0.1'
    compile 'com.google.android.gms:play-services:12.0.1'
    compile 'com.android.support:design:27.1.0'
    compile 'com.android.support:cardview-v7:27.1.0'
    compile 'com.android.support:recyclerview-v7:27.1.0'
    implementation 'com.firebaseui:firebase-ui-database:3.3.0'
    
    }
    apply plugin: 'com.google.gms.google-services'
    

    并构建。gradle(项目)为:

    buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.2.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    }
    
    allprojects {
    repositories {
        google()
        jcenter()
    }
    }
    
    task clean(type: Delete) {
    delete rootProject.buildDir
    }
    

    我得到了一个错误:

    Error:FAILURE: 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 12.0.1.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    

    我已更改com的版本。谷歌。安卓gms到12.0.1(如上面的代码所示),但它仍然显示了这个错误,我应该怎么做?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Peter Haddad    7 年前

    更改以下内容:

    implementation 'com.google.firebase:firebase-auth:12.0.0'
    

    对此:

    implementation 'com.google.firebase:firebase-auth:12.0.1'
    

    所有firebase依赖项都需要相同的版本。

    推荐文章