14

I have this problem after upgrade AndroidStudio to 3.0 Canary 1

Error:D:\Project\Freelance\Andoid\sosokan-android\sosokan-android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:911 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 D:\Project\Freelance\Andoid\sosokan-android\sosokan-android\app\build\intermediates\res\merged\debug D:\Project\Freelance\Andoid\sosokan-android\sosokan-android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
  Issues:
   - ERROR: D:\Project\Freelance\Andoid\sosokan-android\sosokan-android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:911 invalid drawable

It look same AAPT2 compile failed: invalid dimen on Android 3.0 Canary 1 but I can not find the way to make it work on Window

Any help or suggestion would be great appreciated.

pixel
  • 24,905
  • 36
  • 149
  • 251
Linh
  • 57,942
  • 23
  • 262
  • 279

2 Answers2

9

did you see this https://www.reddit.com/r/androiddev/comments/4u0gw1/support_library_2411_released/

If you are using support libraries on version 24.x (you or even your dependencies), this is incompatible with AAPT2 and you should :

  • disbale aapt2 in your gradle.properties file :android.enableAapt2=false
  • or upgrade google libraries to version 25 or 26
Zoubiock
  • 1,165
  • 1
  • 8
  • 10
4

@Phan Van Linh, can you please check the line from "values.xml:911" where you are getting the invalid drawable issue & google it exactly?

I had the same issue with one of my project and the problematic line was:

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


It was from an image library I had used in my project. The issue was that I was using an older version of the library. Once I updated to newer version, the error was gone.

Hopefully, your issue might get fixed like mine.

Happy Hunting!

Riddhish Ojha
  • 155
  • 3
  • 15