Task :processDebugResources Failed to execute aapt com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.builder.core.AndroidBui
I ran into this very issue today morning and found the solution for it too. This issue is created when you have messed up one of your .xml files. I'll suggest you go through them one by one and look for recent changes made. It might be caused by a silly mistake.
In my case, I accidentally hardcoded a color string as #FFFFF(Bad practice, I know). As you can see it had 5 F instead of 6. It didn't show any warning but was the root of the same issue as encountered by you.
Edit 1: Another thing you can do is to run assembleDebug in your gradle console. It will find the specific line for you.
Edit 2: Adding an image for reference to run assembleDebug.
I had this error and no meaningful message to tell me what was wrong. I finally removed this line from gradle.properties and got a meaningful error message.
android.enableAapt2=false
In my case somebody on the team had changed a .jpg extension to a .png and the file header didn't match the extension. Fun.
Seeing your logs :
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ... 1 more Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.java:454) at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:411) at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:332) at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)
I feel some PNG files are corrupted and were not parsed. Sometimes the images have an extension but are not real PNG.
You can check if the images in your project are real PNGs with the below command :
find . -type f -name "*.png" | xargs -L 1 -I{} file -I {} | grep -v 'image/png; charset=binary$'
After getting the list use this site to convert them to PNG. Then check your build again.
I faced similar problem. Akilesh awasthi's answer helped me fix it. My problem was a little different. I was using places_ic_search icon from com.google.android.gms:play-services-location The latest version com.google.android.gms:play-services-location:15.0.0 does not provide the icon places_ic_search. Because of this there was a problem in the layout.xml files.That led to build failure AAPT2 error: check logs for details as the message. Android studio should be showing cannot find drawable places_ic_search as the message instead.
I ended up using a lower version of com.google.android.gms:play-services-location temporarily. Hope this helps someone in future.
someone might get some help from my case
I just put a hard coded color hex value without #
like this by mistake android:textColor="FFA500"
almost made me mad to findout. #FFA500
this solved my issue
I fixed the ERROR with three steps
1. I checked for the problem SOURCE
2. Provided the correct string/text, because it was the CAUSE
3. I cleaned the project, you ll see it under BUILD.