Adding google services - Execution failed for task ':app:processDebugResources' - android

I'm trying to Implement GCM Client in Android Studio following the steps on this website:
Implementing GCM Client on Android
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.+'
}
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
I've already tried to change
compile 'com.google.android.gms:play-services:7.+'
to i.e.
compile 'com.google.android.gms:play-services:7.8.0'
but the same error has occurred.
I've also read some posts about gradle errors while adding google services but nothing has helped yet.
Thank you!

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.
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.

Related

:app:processDebugResources FAILED gradle

everything was working fine i dont know what happend
no its not an XML file..not its not clean rebuild ..no its not sync ...sos what could it be...
this is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "seniorreminder.androidstudioprojects.com.seniorreminder"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
}
this is the error Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\User-Pc\AppData\Local\Android\Sdk\build-tools\25.0.3\aapt.exe'' finished with non-zero exit value -1073741818
please someone help
Your virus scanner (Avast for me) probably detected this threat as a false positive for malware. This happened and it alerted me. You must take it out of quarantine or allow it. If you can't, I recommend re-downloading build-tools version.
From: https://developer.android.com/studio/intro/update.html
"Open the SDK Manager from Android Studio, click Tools > Android > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool.
When an update is available for a package you already have, a dash appears in the check box next to the package.
To update an item or install a new one, click the check box so it shows a checkmark."

My Android project Build Failed and never execute the project?

My question is, I was try to change the package name of my android project, when I build my project it's give me error, And then I pressed ctrl+z button to rewrite my package name before and try to built it again it's not build my project.
my error is
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\DELL\Documents\adt-bundle-windows-x86-20140702\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1
First you see the screen shot
now you see my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "app.tabsample"
minSdkVersion 15
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.1.0'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-ads:8.3.0'
}
I have a latest build version
classpath 'com.android.tools.build:gradle:1.3.0'
and also I tried to clean and rebuild the project and also I tried to restart the Android studio but the error not goes. It's my complete whole project.
As written in the first error, you have a space which is an invalid character in the category tag it should be <category android:name=android.intent.category.default/>.

Execution failed for task app:compileDebugAidl: aidl.exe finished with non-zero exit value 3

I am trying to build my project with AIDL example. But I keep getting this error:
:app:compileDebugAidl
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Error:Execution failed for task ':app:compileDebugAidl'.
> com.android.ide.common.process.ProcessException:org.gradle.process.
internal.ExecException:
Process 'command 'C:\Users\xuefu\AppData\Local\Android\sdk\build-tools\23.0.1\aidl.exe''
finished with non-zero exit value 3
Information:BUILD FAILED
below is my build file and I am using Android Studio 1.3.2, Gradle 1.3.0 under the windows 8.1 x64 platform:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "org.crazyit.service"
minSdkVersion 10
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
}
Please check your aidl files, make sure all the files include the package name. e.g.
package com.zebra.gogogo;
parcelable GoInfo;

Importing error from eclipse to android studio

I am importing eclipse project, and project has some libraries like googleplay service, google uri auth and parse. Now I am importing an eclipse project in android studio but I am facing an error. I had tried cleaning the project and all the things that is required but I didn't get the reply. Below is my error:
Error:Execution failed for task ':weddinhHall:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command
'C:\Program Files (x86)\Java\jdk1.7.0\bin\java.exe'' finished with
non-zero exit value 2
and my build.gradle file is like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.xxx.xxxxxx.main"
minSdkVersion 14
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':parallaxScroll')
compile project(':googleDateTimePickers')
compile 'com.google.android.gms:play-services:+'
compile files('libs/google-api-client-1.10.3-beta.jar')
compile files('libs/google-http-client-1.10.3-beta.jar')
compile files('libs/google-oauth-client-1.10.1-beta.jar')
compile files('libs/google-play-services.jar')
compile files('libs/Parse-1.5.0.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
}
Has anyone met this issue before?
Please remove compile files('libs/google-play-services.jar') . dexDebug occurs when duplicate entry happen . You already initialize google play service compile 'com.google.android.gms:play-services:+'.
FYI: Please use latest google play service version , like compile 'com.google.android.gms:play-services:5.0.89'

zipalign.exe'' finished with non-zero exit value

I'm a student programmer and I'm continuing an Android project that has been previously started by other students before me. My problem is that I'm getting an error when I try to execute the Android app inside Android Studio. You can see the error message below. The compilation must have worked for the other students since I have an apk file. What's wrong with zipalign?
:app:zipalignDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:zipalignDebug'.
> Process 'command 'X:\Sdk Android Studio\build-tools\21.1.2\zipalign.exe''
finished with non-zero exit value -1073741502
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "csf.dfc.friendtracker"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile files('libs/guava-18.0.jar')
compile files('libs/Pubnub-Android-3.7.2.jar')
compile files('libs/mysql-connector-java-5.1.34-bin.jar')
}
EDIT:
I haven't found the cause of the error but I added all the project objects in a new one and the error disappeared.
Remove the apk file in the Deploy directory and the export worked fine then.
I realized this happen when you have the directory "..\app\build\outputs\apk\" open in your Windows Explorer. You just need to close it and rebuild the project.
This happened to me too, when I tried to generate the apk in the following path:
C:\users\desktop
Change your signed generated apk destination path used to generate to the following:
<your project path>\app\build\outputs\apk
Example:
E:\androidStudio\CountDownTimer\app\build\outputs\apk

Categories

Resources