8

I'm using Android Studio 3.0 Canary 3 on Arch Linux and I am playing around with it trying to make a small app. Made some research before posting the question but none of the solutions I found doesn't work for me. Any help would be much appreciated. Thanks

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/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/res/merged/debug /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml
  Issues:
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:244 invalid dimen
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:245 invalid dimen
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:283 invalid dimen
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:309 invalid dimen
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:310 invalid dimen
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:312 invalid dimen
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:313 invalid dimen
   - ERROR: /home/xhensi/AndroidStudioProjects/FindRestaurant/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:314 invalid dimen
Xhens
  • 804
  • 3
  • 13
  • 33
  • 1
    Still present in Android Studio 3, Canary 5 (Ubuntu). – Josef Adamcik Jul 06 '17 at 13:41
  • 1
    And actually this is a dupliacate of https://stackoverflow.com/questions/44196672/aapt2-compile-failed-invalid-dimen-on-android-3-0-canary-1#44202755 (more and better answers included) – Josef Adamcik Jul 06 '17 at 13:43
  • Possible duplicate of [AAPT2 compile failed: invalid dimen on Android 3.0 Canary 1](https://stackoverflow.com/questions/44196672/aapt2-compile-failed-invalid-dimen-on-android-3-0-canary-1) – LBBO Jan 07 '19 at 09:01

1 Answers1

12

Update:

I found how to fix this issue. Hope this answer helps others too!

Apparently, my Linux Formats settings were in German de_DE. I changed them to en_US. Write these command in your terminal:

export LC_NUMERIC="en_US.UTF-8"

source ~/.bashrc

Then, in my case, it worked after a system restart (normally it should also work with a log off).

More information about setting:

https://askubuntu.com/questions/724338/how-to-set-lc-numeric-to-english-permanently

Xhens
  • 804
  • 3
  • 13
  • 33
  • 1
    Environment variables, such as LC_NUMERIC, will not be preserved after a restart if you just set them with a command in a terminal. You need to add it to an init file. – Thomas Padron-McCarthy Jun 12 '17 at 05:04
  • 5
    How about on MacOSX? – Etienne Lawlor Jun 28 '17 at 06:11
  • Add the line `export LC_NUMERIC="en_US.UTF-8"` into your users shell profile (etc ~/.bashrc). It will become available after next restart and login into the users profile. Second way to make the variable LC_NUMERIC available is to run `source ~/.bashrc` and your current shell profile will be updated – lukassos Aug 19 '17 at 20:46