how to fix 23.0.1\aapt.exe'' finished with

2020-02-01 06:59发布

All of a sudden I cannot get Gradle to build any projects under Android Studio.

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

My Gradle is

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.marathon.simplelist"
        minSdkVersion 8
        targetSdkVersion 22
        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:23.0.1'
}

Even if I create a new Blank Activity project I still get this error.

I have Android Studio 1.3.1 installed with

SDK Platforms: 5.X, 5.1, 5.0, 4.4, 2.3.3 SDK Tools: SDK Build Tools, SDK Tools 24.4, Platform-Tools 23.0.1

Obviously something is reconfigured locally since even a new empty project will not build. Ideas on how I can resolve this?

标签: android
27条回答
看我几分像从前
2楼-- · 2020-02-01 07:00

I also faced the same issue and worked for hours on it and finally found out the solution. The drawable file that I referred in my xml was not existed. I removed the code and rebuild the project. It worked. My advice if anyone face such an issue, please look into your res folder.

查看更多
Anthone
3楼-- · 2020-02-01 07:00

Add Below Library in gradle file .

compile "com.android.support:appcompat-v7:26.0.2"
compile "com.android.support:support-v13:26.0.2"

查看更多
不美不萌又怎样
4楼-- · 2020-02-01 07:02

Goto gradle.properties under Gradle Scripts
then set android.enableAapt2=true
clean and Rebuild the project

查看更多
对你真心纯属浪费
5楼-- · 2020-02-01 07:03

Have got the same error in React Native.I upgraded the android sdk version and resulted into this.

Root cause : old version's packager collect resources.

Solution : delete directories like 'drawable-xxxx' (ATTN:no 'v?' postfix) under $(rn_project)\android\app\src\main\re.

Reference :https://github.com/facebook/react-native/issues/5787#issuecomment-236408669

查看更多
地球回转人心会变
6楼-- · 2020-02-01 07:06

If the error is occuring while Gradle Processes Resources, then it is most likely an issue with your resources. Check your gradle console to make sure.

Double check any recent changes that you may have made to the res folder. In my case, I simply renamed a resource (banner.png to something_else_banner.png since banner.png must have been reserved), and it worked!

Other things I tried that failed:

  • Based on the answer by mixel, i tried to pngcrush and optipng my png that lead my to beleive that it could be an issue with my resources since the Gradle Console showed that the error occured during :app:processDebugResources FAILED.
  • Build -> clean project Build -> rebuild project failed
查看更多
一夜七次
7楼-- · 2020-02-01 07:06

Always try to use the latest one for build tools. You have to change the line buildToolsVersion "XX.X.X" in build.gradle file (which generally resides under mobile directory in gradle 2.0) to the latest version : 23.0.2 or 24.0.2 or 25.0.2 (in my case). And then Rebuild Project. If you still have an issue, please try to update the corresponding build tool via Android SDK Manager.

查看更多
登录 后发表回答