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条回答
Root(大扎)
2楼-- · 2020-02-01 07:07

In my case, i was wrongly mentioned dp as d in dimension file. That cause this issue, once i corrected that value everything working fine. So due to some new added wrong values or files may cause this issue.

查看更多
啃猪蹄的小仙女
3楼-- · 2020-02-01 07:10

I've got the same problem. The solution was to move project folder into drive root folder. It looks like my project folder has huge path ("D:\DropBox\Dropbox\Video\Full Stack Web Development\Course 4 - Multiplatform Mobile App Development with Web Technologies\Week 3 - Deploying your App\Exercise 1\ionic\conFusion\"). After moving "Exercise 1" folder to the root of disk D, problem was gone.

查看更多
仙女界的扛把子
4楼-- · 2020-02-01 07:11

Mostly, this problem cause by wrong resource in xml file, I suggest you return your code before everything is fine. then add your new code step by step and check xml file carefully.

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

It might be a bit too late to answer, but I didn't find a perfect answer, so here what worked for me:

  • make sure that all your files/fields in /res/ are correct.

I renamed couple of fields in attrs > declareStylable so they were pointing to non-existant enums and that's what caused a error for me.

查看更多
何必那么认真
6楼-- · 2020-02-01 07:14

In my case, I backtracked everything that I implemented and found that the issue was in the xml layout file that I was using for my login screen.

The relation that I had defined among the child views within the RelativeLayout(parent layout), was causing the error.

So the way to avoid such errors in future is to keep running/checking the code as soon as you implement anything, to avoid long backtracking(which was in my case).

Hope this would be of some help!

查看更多
做个烂人
7楼-- · 2020-02-01 07:15

I spent nearly 12 hour to find the resolution to this issue and finally I found the resolution.

This kind of supernatural issue, might happen in the below cases,

  1. When your code has some problem, like sometimes IntelliJ/AndroidStudio does not report the compilation errors. Open each class and check for any compilation issues, these compilations issues will be because of not able to resolve few dependencies.

  2. When you have a library that is latest, but you are referring to the oldest version.(Similar to point 1).

  3. When you have a library that is dependent on some other library and that in turn referencing to old library, but your direct library is referring to newer version.

  4. Importing from JFrog Artifactory, but your cache is not cleared, and you app is still holding to older version of .aar file

  5. Your current gradle version of the app is latest, but you imported some other project as library and that version is older.

  6. Your current gradle version of the app is latest, but you imported .aar file from jfrog artifactory and that is build from older gradle version.

when you are trying all the above cases, clean and build, or if this doesn't work, try "invalidate cache and Restart".

error like this will fall in some or the other above mentioned cases.

Happy Coding..!

查看更多
登录 后发表回答