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

后端 未结 27 2997
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 16:18

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

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

相关标签:
27条回答
  • 2020-12-06 17:04

    If someones is using react-native (and have updated it's version recently) and having this problem:

    Quoting @chamchamgo:

    I found the root cause is that old version's packager collect resources (image etc.) and put under $(rn_project)\android\app\src\main\res, while newer version put them under $(rn_project)\android\app\build\intermediates\res\merged\$(buildType). It brings duplication which leads to failure of task 'processReleaseResources'. And it also explains why new created project works well. When you have an old RN project upgrading to newer version, just delete directories like 'drawable-xxxx' (ATTN:no 'v?' postfix) under $(rn_project)\android\app\src\main\res and wolrd will be nice.

    Check the whole thread at: https://github.com/facebook/react-native/issues/5787#issuecomment-236408669

    0 讨论(0)
  • 2020-12-06 17:04

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

    0 讨论(0)
  • 2020-12-06 17:05

    Change The buildToolsVersion To compileSdkVersion as Shown Below Code:...

    Before: It Was Not Working....

    android {
        compileSdkVersion 23
        buildToolsVersion '22.0.1'
        defaultConfig {
            applicationId 'com.kdmsl.kraapp'
            minSdkVersion 14
            versionCode 3
            versionName "1.3"
            aaptOptions {
                additionalParameters "--no-version-vectors"
            }
        }
    

    After Changes:

    android {
        compileSdkVersion 23
        buildToolsVersion '23.0.0'
        defaultConfig {
            applicationId 'com.kdmsl.kraapp'
            minSdkVersion 14
            versionCode 3
            versionName "1.3"
            aaptOptions {
                additionalParameters "--no-version-vectors"
            }
        }
    
    0 讨论(0)
提交回复
热议问题