【问题标题】:Android Studio: Execution failed for task ":app:processDebugGoogleServices" error after added Firebase StorageAndroid Studio:添加 Firebase 存储后任务“:app:processDebugGoogleServices”错误执行失败
【发布时间】:2017-06-24 03:43:00
【问题描述】:

我刚刚将代码添加到我的 Android Studio 项目以使用 Firebase 存储并收到此错误:

任务“:app:processDebugGoogleServices”执行失败。 请通过更新版本来修复版本冲突 google-services 插件(有关最新版本的信息可在 https://bintray.com/android/android-tools/com.google.gms.google-services/) 或 将 com.google.android.gms 的版本更新为 10.0.1。

这是我的 app/build.gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "myappIDhere"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1     
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile files('libs/commons-codec-1.10/commons-codec-1.10.jar')
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:design:26.+'
    compile 'com.google.gms:google-services:3.1.0'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.google.firebase:firebase-storage:11.0.1'
    testCompile 'junit:junit:4.12'
}

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

这是我的项目级 build.gradle 文件:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}
allprojects {
    repositories {
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

google-services.json 文件中的 package_name 与清单中的相同。我需要改变什么?

【问题讨论】:

    标签: android android-studio firebase gradle


    【解决方案1】:

    只需更新你的依赖项

     compile 'com.google.firebase:firebase-auth:11.0.1'
     compile 'com.google.firebase:firebase-database:11.0.1'
     compile 'com.google.firebase:firebase-storage:11.0.1'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-28
      • 1970-01-01
      • 2016-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多