Exception : AAPT2 error: check logs for details

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.

Leave a Comment