> Executing tasks: [:app:assembleDebug]
>
> WARNING: The option 'android.enableAapt2' is deprecated and should not
> be used anymore. Use 'android.enableAapt2=true' to remove this
> warning. It will be removed at the end of 2018. :app:preBuild
> UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:compileDebugAidl
> UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE
> :app:checkDebugManifest UP-TO-DATE :app:generateDebugBuildConfig
> UP-TO-DATE :app:prepareLintJar UP-TO-DATE
> :app:mainApkListPersistenceDebug UP-TO-DATE
> :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources
> UP-TO-DATE :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT error: check logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
> BUILD FAILED in 13s 9 actionable tasks: 1 executed, 8 up-to-date
-
3Possible duplicate of [AAPT2 error: check logs for details](https://stackoverflow.com/questions/47589873/aapt2-error-check-logs-for-details) – Akhilesh Awasthi Feb 17 '18 at 13:34
-
First of all, you probably disabled AAPT2 with the android.enableAapt2 flag because you were getting errors from AAPT2. Now you're getting errors from AAPT1 - meaning there's something actually wrong with your resources. The errors should be visible in the full build log. If you're having trouble finding it, you can manually run it by going to the project directory and executing "./gradlew clean assembleDebug". – Izabela Orlowska Feb 19 '18 at 10:48
-
Yes, I see this error in my build after Android Studio was upgraded to 3.1 – cVoronin Mar 28 '18 at 05:34
-
You need to post your whole build log so we can see what the problem is. Run "./gradlew clean assembleDebug" in your project directory and post the output in the question. – Izabela Orlowska Apr 24 '18 at 13:15
-
Also try with a newer gradle plugin - 3.2.0-alpha11 or newer – Izabela Orlowska Apr 25 '18 at 13:16
-
Possible duplicate of [Where to find aapt2 logs?](https://stackoverflow.com/questions/48400895/where-to-find-aapt2-logs) – Zoe Jun 09 '19 at 14:28
6 Answers
In gradle.properties change android.enableAapt2=false
to true

- 7,072
- 3
- 23
- 30
-
6after changed it to true, got error `hdpi/node_modules_reactnavigation_src_views_assets_backicon.png: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. ` – TomSawyer Jun 05 '18 at 03:30
-
I am facing same issue, when i have updated my Android Studio. I have change android.enableAapt2=false to true and it works for me. – Sachin Jun 15 '18 at 06:56
-
2Sorry, but from what I have read this hides the warning but I am not sure if this will solve the actual issue. – rgv Jun 28 '18 at 18:16
-
(1) update android studio (2) restart android studio (3) set `android.enableAapt2` to true – flyingpluto7 Sep 10 '18 at 16:24
-
1Earlier was getting this error :The option 'android.enableAapt2' is deprecated and should not be used anymore. After making true getting this error :Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details – Tarit Ray Apr 05 '19 at 10:29
You can actually have problems in the resources but these will not be displayed if you do not correct this problem first:
The option 'android.enableAapt2' is deprecated and should not be used anymore. Use 'android.enableAapt2 = true' to remove this warning. It will be removed at the end of 2018.
within your gradle.properties
file that is located in the root of the project, replace:
android.enableAapt2
with:
android.enableAapt2 = true

- 124,308
- 23
- 334
- 268
within gradle.properties file that is located in the root of the project,
I have just commented on this line, now works perfectly
android.enableAapt2 = true

- 582
- 5
- 19
Please make sure that the images and icons you included in your project is Imported by android studio or Drawable importer plugin.
to install this plugin you have to go File>setting> plugin. then type Drawable importer

- 1,639
- 1
- 16
- 25

- 1
- 1
-
This has to do with Gradle properties when syncing. This isn't even close to the same thing. – Nathan Kellert Aug 27 '20 at 16:48
Your problem is with android.enableAapt2
.
You should check what's missing or the package is imported correctly.
Search for file android.enableAapt2
or that keyword.

- 784
- 1
- 12
- 15

- 251
- 2
- 9
-
The "android.enableAapt2" message is just a warning, since AAPT1 will be deprecated soon and so disabling AAPT2 is not recommended. The real errors should be visible in the build log. – Izabela Orlowska Feb 19 '18 at 10:48