Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle 3.0 Alpha 2 throwing exception while Alpha 1 works fine

Tags:

android

gradle

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

Alpha1 works ok 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 drawable Error:java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed: Error:Execution failed for task ':app:mergeDebugResources'.

Error: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile 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\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml Issues: - 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 a third library: Android Image Cropper

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

What can it be?

like image 835
reinaldomoreira Avatar asked May 29 '17 11:05

reinaldomoreira


1 Answers

Found out that with Gradle plugin 3.0-alpha2 and above, resource values have to be defined, and the library does not define this resource.
For anyone who wants to follow up on this issue and a temporary fix Undefined Drawable
Temporary fix taken from the link Before this gets merged and shipped, you can still use the library by declaring in your app resources

<item name="crop_image_menu_crop" type="drawable">@null</item>
like image 126
reinaldomoreira Avatar answered Oct 18 '22 13:10

reinaldomoreira