本文介绍了添加谷歌服务 - 任务“:app:processDebugResources"执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照本网站上的步骤在 Android Studio 中实现 GCM 客户端:在 Android 上实现 GCM 客户端

I'm trying to Implement GCM Client in Android Studio following the steps on this website:Implementing GCM Client on Android

如设置 Google Play 服务"所述,我编辑了应用程序的 build.gradle 文件,使其看起来像这样:

As mentioned under "Set Up Google Play Services" I edited my application's build.gradle file so that it looks like that:

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

android {
    compileSdkVersion 20
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.buuurn.gymio"
        minSdkVersion 16
        targetSdkVersion 21
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:23.0.0'
    compile 'com.google.android.gms:play-services:7.+'
}

如果我现在同步 gradle,我会收到此错误消息:

If I sync gradle now I get this error message:

Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Applications/adt-bundle 23/sdk/build-tools/23.0.0/aapt'' finished with non-zero exit value 1

我已经尝试改变了

compile 'com.google.android.gms:play-services:7.+'

到即

compile 'com.google.android.gms:play-services:7.8.0'

但发生了同样的错误.

我还阅读了一些关于在添加 google 服务时出现 gradle 错误的帖子,但没有任何帮助.

I've also read some posts about gradle errors while adding google services but nothing has helped yet.

谢谢!

推荐答案

您是否尝试过检查您的buildToolsVersion"?如果没有,请转到设置->应用程序->属性->检查您的构建版本以查看是否找到它,如果没有,请使用您拥有的最大版本或更新它.

Have you tried to check your "buildToolsVersion"? If not, go to setting->app->properties->check your build version to see if you find it, if not use the max version you have or update it.

关于这个错误:finished with non-zero exit value 1"有几个原因,如果是内存引起的,尝试重启你的设备,如果是你的java环境引起的,也许你应该重新安装.

Regarding this error:"finished with non-zero exit value 1" there are several reason, if it caused by RAM, try restart your device, if it caused by your java environment, maybe you should reinstall.

这篇关于添加谷歌服务 - 任务“:app:processDebugResources"执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 11:27