Android Studio 3.0, AAPT2 compile failed - invalid dimen in resource file

XhensB picture XhensB · Jun 10, 2017 · Viewed 9k times · Source

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

Answer

XhensB picture XhensB · Jun 10, 2017

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