Gradle 3.0 Alpha 2 metadata exception while Alpha 1 works fine

dependencies { classpath 'com.android.tools.build:gradle:3.0.0-alpha2' } 

Alpha1 works fine for me with Android Studio 3.0 canary 2,
but when I try to use alpha2, I get this exception:

Error: C: \ Users \ STD1 \ Documents \ STD1 \ InvistaCultura \ invistacultura-android \ app \ build \ intermediates \ incremental \ mergeDebugResources \ merged.dir \ values ​​\ values.xml: 752 invalid code Error: java.lang. RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compilation failed: Error: execution completed for task ': app: mergeDebugResources'.

Error: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compilation failed: aapt2 compile -o C: \ Users \ STD1 \ Documents \ STD1 \ InvistaCultura \ invistacultura-android \ app \ build \ intermediates \ res \ merged \ debug C: \ Users \ STD1 \ Documents \ STD1 \ InvistaCultura \ invistacultura-android \ app \ assembly \ intermediate \ incremental \ mergeDebugResources \ merged.dir \ values ​​\ values.xml Questions: - ERROR: C: \ Users \ STD1 \ Documents \ STD1 \ InvistaCultura \ invistacultura-android \ app \ build \ intermediates \ incremental \ mergeDebugResources \ merged.dir \ values ​​\ values.xml: 752 invalid drawable

and, in values.xml: 752, I find this line, which is from the third library: Android Image Cropper

 <item name="crop_image_menu_crop" type="drawable"/> 

What could it be?

+5
source share
1 answer

I learned that with the Gradle 3.0-alpha2 plugin and higher, the resource values ​​must be defined, and the library does not define this resource.
For those who want to track this problem and interim fix Undefined Drawable
Interim fix taken from the link Before it is merged and sent, you can still use the library by declaring applications in your resources

 <item name="crop_image_menu_crop" type="drawable">@null</item> 
+5
source

Source: https://habr.com/ru/post/1268323/


All Articles