\build\intermediates\res\resources-anzhi-debug-stripped.ap_' specified for property 'resourceFile' does not exist

后端 未结 8 933
攒了一身酷
攒了一身酷 2020-12-01 05:05

I updated Android Studio to version 2.0. The build failed and also takes longer than Android Studio version 1.5 to build. Every time I run my application, I clean and reload

相关标签:
8条回答
  • 2020-12-01 05:26

    Found an answer, just disable instarun and it should work. It worked for me.

    0 讨论(0)
  • 2020-12-01 05:30

    Set shrinkResources to false. It worked for me

    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable false
            jniDebuggable false
            zipAlignEnabled true
        }
    }
    
    0 讨论(0)
  • 2020-12-01 05:30

    In my project, because I added in the gradle shrinkResources, remove the Ok.

    0 讨论(0)
  • 2020-12-01 05:32
    1. We could use both Instant Run and shrinkResources at the same time;
    2. Please be noted that we CANNOT use Jack and shrinkResources at the same time (the same to ProGuard, minifyEnabled)
    0 讨论(0)
  • 2020-12-01 05:36

    Having same issue ! So instant run is not compatible with shrinkResources

    1) if use Android Studio 2.2

    shrinkResources false

    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
            shrinkResources false
            zipAlignEnabled true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    

    2) if use Android Studio 2.0

    • open setting

    • Follow this image

    • now run your project

    0 讨论(0)
  • 2020-12-01 05:45

    If you're experiencing this issue when building a release build, keep in mind that Android Plugin for Gradle 2.2.0 (and above) seems to have a bug with shrinkResources.

    Downgrade gradle to 2.1.3 for a temporary solution:

    classpath 'com.android.tools.build:gradle:2.1.3'
    

    EDIT:

    I reported this issue to wojtek.kalicinski (Android Developer Advocate at Google).

    As it turns out, shrinkResources works only if there is minifyEnabled set to true. 2.1.3 version of Android Plugin was just ignoring the issue (and failing to shrinkResources silently). 2.2.0+ is letting you know that there is something wrong with an error (which itself isn't really informative). Google might introduce a better error message for this kind of scenarios in the future.

    Here's the twitter conversation:

    0 讨论(0)
提交回复
热议问题