2

When project is built with build:gradle:3.0.1, I've got this error.

AAPT2 error: check logs for details

I've tried solution

android.enableAapt2=false

in gradle.properties file mentioned in this thread:

Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

It works, but Java compiler gives warning,

WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.

Can we resolve AAPT2 error without using android.enableAapt2=false ?

  • 1
    AAPT2 is much stricter than AAPT1 (for finding errors at build time instead of run-time). There is something wrong with your resources and so it fails the build. Try to include the full build log (without disabling AAPT2) and we can work together to figure out where the error is. – Izabela Orlowska Apr 17 '18 at 15:49
  • If you're having trouble finding the build log, then you can go to the directory of the project and run "gradlew clean assembleDebug" and paste the output here (or gradlew.exe on windows) – Izabela Orlowska Apr 17 '18 at 15:50

1 Answers1

1

In my case, the error was beacause in the route where android studio was installed, i had a non-ASCII character (an accent to be more specific).

The most common case of this error is beacause the file manifest.xml have errors in it's structure.

Here is the structure it should have: https://developer.android.com/guide/topics/manifest/manifest-intro?hl=es-419