Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to fix 22.0.1\aapt.exe'' finished with non-zero exit value 1

Tags:

android

I was coding in android studio then this error will appear:

cannot resolve symbol 'R'

Error:Execution failed for task ':demo:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Android Development\sdk\android-sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

this is my Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'

    defaultConfig {
        applicationId "br.liveo.ndrawer"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

dependencies {
    compile project(':library')
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:design:22.2.0'
    compile 'com.android.support:appcompat-v7:22.2.0'
}

I use Android Studio V 1.0 , all API 22 and API 21 and Tools and Extras of SDK Manager are updated.

this options not working:

File/ Invalidate Cashes/Restart

Build/ Rebuild Project

Build/ Clean Project

what should I do know?

tnx

like image 361
Salar Rastari Avatar asked Jun 17 '15 18:06

Salar Rastari


4 Answers

I solve my problem:

1) check all your XML files for given unknown src. ImageView or ImageButton or any think, et:

android:src="@drawable/cards"

then

Build/ Rebuild Project

or

Build/ Clean Project

or

File/ Invalidate Cashes/Restart

Your problem will solve for sure 100% :D

like image 192
Salar Rastari Avatar answered Nov 12 '22 05:11

Salar Rastari


This error can be raised because of duplicate resources/files. To find out the names and path of duplicate resources:

  1. Go to File > Settings > Build, Execution, Deployment. Select Compiler from sub-options.

  2. Type --debug against Command-line Options. Press Ok.

enter image description here

  1. Run your project. In the Messages Window of AS, compiler will tell you about all problems.

enter image description here

Hope it helps!

like image 38
NightFury Avatar answered Nov 12 '22 06:11

NightFury


I found a solucion problem was because I add 2 image one in drawable and other one in drawable-es but in this last the name was (same than drawable for example myimagen.jpg) but the extencion was in uppercase

in drawable this was myimagen.jpg and drawable-es it was myimagen.JPG

I rebuild, clean, and rebuild, re-start android studio, re-start my pc and it did not work, then I thoungh my be the name because my error say "processdebugresources"

Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\auc\AppData\Local\Android\sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1

like image 2
angel Avatar answered Nov 12 '22 06:11

angel


I was compiling with build version 23.0.2 and realized 23.0.3 was available in the Android SDK. Installed the newer version, changed build version in build.gradle, and Android build worked after that.

Should also note that this error didn't start happening until I changed my splash screen images to 9-patch.

like image 2
nocoded Avatar answered Nov 12 '22 06:11

nocoded