如何修复错误:任务执行失败':app:processDebugGoogleServices'

时间:2016-04-07 15:31:31

标签: android android-gradle gradle-plugin

如何修复

Error:Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'com.talada.myapplication'

我更改了com.google.android.gms:play-services-gcm:8.4.0' to com.google.android.gms:play-services-gcm:8.3.0'和distributionUrl = https://services.gradle.org/distributions/gradle-2.12-all.zip到distributionUrl = https://services.gradle.org/distributions/gradle-2.10-all.zip

不能正常工作。

的build.gradle(APP)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.talada.myapplication"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'

    compile 'com.google.android.gms:play-services-gcm:8.4.0'
}
apply plugin: 'com.google.gms.google-services'

build.gradle(project)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'com.google.gms:google-services:2.0.0-rc3'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip

1 个答案:

答案 0 :(得分:0)

编译
dependencies {
        compile 'com.google.android.gms:play-services:9.6.1'
}

并删除

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