Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating to Android Studio 3.0 Canary 2 give build errors [duplicate]

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
like image 313
Ayush P Gupta Avatar asked May 28 '17 11:05

Ayush P Gupta


1 Answers

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:

  1. Open terminal
  2. Type: 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 :(

like image 110
Kamil Kamiński Avatar answered Sep 21 '22 13:09

Kamil Kamiński