Today I updated my Studio to Canary 2 and a strange build error arises:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :multipicker:generateDebugSources, :multipicker:generateDebugAndroidTestSources, :multipicker:mockableAndroidJar]
Information:0 errors
Information:0 warnings
Information:See complete output in console
Error:/home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:795 invalid drawable
Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile -o /home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/res/merged/debug /home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml
Issues:
- ERROR: /home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:795 invalid drawable
Information:BUILD FAILED in 11s
I managed to run Android Studio 3 Canary 2 with Gradle 3.0.0-alpha2 based on this answer: https://stackoverflow.com/a/44202755/3936723
I use Linux, and for me this solved the problem:
export LC_NUMERIC="en_US.UTF-8"
sh ./android-studio/bin/studio.sh
--OLD ANSWER--
It will work in Android Studio 3.0 Canary, if you change Gradle to
classpath 'com.android.tools.build:gradle:2.3.2'
I have the same error with com.android.tools.build:gradle:3.0.0-alpha2
version, rolling back to previous version of Gradle fix a problem for me.
Unfortunately, with older gradle plugin, I can't use advanced options in Android profiler :(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With