11

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
halfer
  • 19,824
  • 17
  • 99
  • 186
Ayush P Gupta
  • 1,459
  • 1
  • 17
  • 24
  • Probably handle this in googles bug tracker, issues with nightly builds on some software are probably not very well suited for so. – Patrick May 28 '17 at 12:58
  • I'm voting to close this question as off-topic because it probably only describes a bug in a very specific early version of Android studio – Patrick May 28 '17 at 13:00
  • isn't a Android Studio error. Its a Gradle bug – Antony Alkmim May 29 '17 at 13:33

3 Answers3

10

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 :(

Kamil Kamiński
  • 389
  • 2
  • 12
  • 1
    Thank you, I did change directly my system settings (KDE neon), in regional settings I had "US" region, and detail settings "off", so it did look ok (also examples at bottom of formatted values did look OK!), but the disabled grayed out details were showing numeric/currency/date... as "Czech republic"... so just for curiosity I enabled details, and switched the numbers to en_us, logout+login, and build works. I'm not even sure, where to start with reporting, "WTF moment" of the month for sure. – Ped7g Jun 05 '17 at 09:57
0

The solution has been provided here.

You need to change your PC regional format for numbers to one that use the dot as decimal mark, like English US / UK.

Daniele Segato
  • 12,314
  • 6
  • 62
  • 88
-3

Android Studio Canary 2 changes Gradle to com.android.tools.build:gradle:3.0.0-alpha2

A workaround is set back to com.android.tools.build:gradle:3.0.0-alpha1