Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error

Tags:

How can I solve this problem, when I am building it, it is showing me the same problem- java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

I am using classpath 'com.android.tools.build:gradle:3.1.0'

What should be the exact solution. Please let me know as soon as possible.

like image 860
sumit coolbuddy Avatar asked Apr 07 '18 15:04

sumit coolbuddy


2 Answers

There could be a problem in your res folders it could be an image that was not well converted so the solution to this is to update your gradle plugin which will highlight the actual problem

This line classpath 'com.android.tools.build:gradle:3.2.0-alpha18'

Edit your build.gradle file:

 buildscript {     repositories {         google() // important!         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:3.2.0-alpha18'     } }  allprojects {     repositories {         google() // important!         jcenter()     } } 

NOTE This might require to update your gradle to 4.6

like image 174
Derrick Avatar answered Oct 13 '22 18:10

Derrick


I had the same issue. Apparently this line had to be at the top of the main XML file and was 2 or 3 lines below.

<?xml version="1.0" encoding="utf-8"?> 

Cut and pasted to top of XML file and build succeeded.

like image 30
Luke Skywalker Avatar answered Oct 13 '22 18:10

Luke Skywalker