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

I updated Android Studio to version 2.0. Build fails and takes longer than Android Studio version 1.5 to build. Every time I launch my application, I clear and reload the project, but it is useless. Error message:

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

+51
android android-gradle
Apr 11 '16 at 5:47
source share
8 answers

You have the same problem! Thus, instant start is incompatible with shrinkResources

1) if you are using 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 you are using Android Studio 2.0

  • open setting

  • Follow this image

  • Now run the project

+82
Apr 11 '16 at 8:10
source share

If you encounter this problem when creating a release build, keep in mind that the Android plugin for Gradle 2.2.0 (and higher) seems to have an error with shrinkResources .

Reduce gradle to 2.1.3 for workaround:

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



EDIT:

I reported this issue wojtek.kalicinski (Destination for Android Developer on Google).

As it turned out, shrinkResources only works if there is minifyEnabled set to true . 2.1.3 version of Android Plugin simply ignored the problem (and without shrinkResources ). 2.2.0+ lets you know that something is wrong with the error (which in itself is not very informative). In the future, Google may submit a better error message for such scenarios.

Here is twitter :

hfc8R.png

+53
Sep 27 '16 at 10:16
source share

You are probably reducing resources while avoiding minimization:

 minifyEnabled false shrinkResources true 

If you want to compress resources, you need to enable mining:

 minifyEnabled true shrinkResources true 

Older versions of Build Tools ignored this problem, but started sending out compilation problems in Build Tools 2.2.3

More information here: https://developer.android.com/studio/build/shrink-code.html#shrink-resources

+23
Dec 28 '16 at 12:05
source share

Set shrinkResources 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 
+20
Aug 6 '16 at 4:08 on
source share

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

+2
Apr 11 '16 at 8:00
source share
  • We could use both Instant Run and shrinkResources at the same time;
  • Note: we CANNOT use Jack and shrinkResources at the same time (same for ProGuard, minifyEnabled)
+1
Jul 30 '16 at 1:06
source share

As suggested by @ Bartek-lipinski's post, I confirmed in my project that overriding the Gradle plugin in v2.1.3 would solve this problem of getting "InvalidUserDataException: File specified for property does not exist."

I filed an error using the Android website bugtracker tools, please increase the visibility of the problem.

+1
Nov 22 '16 at 19:28
source share

In my project, because I added shrinkResources to gradle, delete Ok.

0
Jan 05 '17 at 1:53 on
source share



All Articles