-3

I have two separate errors relating to AAPT:

The first:

AAPT2 error : check logs for details

The second:

Failed to execute aapt

The first error can be solved by adding android.enableAapt2=false into the gradle.properties file, but this causes the second error to occur.

It appears as if though solving the first means the second never can be solved.

What can I do to get around this?

Kjartan
  • 18,591
  • 15
  • 71
  • 96
molamola
  • 269
  • 4
  • 15

1 Answers1

1

It seems to me that you are just avoiding the first error by disabling it. That will obviously cause problems if you need aapt (or more specifically, aapt2) to run.

As per my understanding, aapt1 will be removed at some point, so it is probably a bad idea to disable aapt2 anyway, as that will be the default in the future.

Instead, try to follow the advice given, and look for the real error in the Aapt log. Most likely there will be something wrong with one of your resource files.

PS: If you run your command with --stacktrace, it might output more useful information.

Kjartan
  • 18,591
  • 15
  • 71
  • 96
  • As @Kjartan said, AAPT1 will be removed soon so disabling AAPT2 is *not* a solution. Just saying that AAPT2 fails is also not enough for people to find the solution to your question. To find the logs you can go to the Terminal window in Android Studio and run "gradlew clean assembleDebug" and the errors will be included in the output. – Izabela Orlowska May 29 '18 at 12:01