Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AAPT2 error in Android Studio 3.0.1

Tags:

android

aapt2

I'm trying to get a "hello world" application running using Android Studio 3.0.1 and get the following AAPT2 error output:

Error:(16) error: not well-formed (invalid token).
Error:(16) not well-formed (invalid token).
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details...

I was not able to find a solution, could someone please help me?

like image 274
Akshat Chawla Avatar asked Jan 30 '18 18:01

Akshat Chawla


People also ask

How to solve AAPT2 error in Android Studio?

To resolve this error, contact the library author to rebuild the library using the latest version of the Android SDK Build Tools and republish the library.


1 Answers

android.enableAapt2=false Don't do this step to temporarily hide the issue. Aapt1 is going to be deprecated soon and Aapt2 has to be used by 2018 end.

This is just an issue with the gradle build tools. Just update your gradle and the gradle tools.

I am using classpath 'com.android.tools.build:gradle:3.3.0-alpha02'' inside dependency tag in Project level gradle and I am using gradle version 4.8 . This fixed the issue for me.

Additional Disable Instant run, if this didn't fix for you

like image 124
emilpmp Avatar answered Sep 28 '22 12:09

emilpmp