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.
AAPT2 Error solution.
If your Android studio has been updated.
Maybe, you would face an error in the studio like "AAPT 2 error: check the log for details"
This error will occur when you have done something wrong in your .xml file such as incorrect value, content not found, etc.
But, At that time you will not have the error specification there. Because the new version of Android Studio does not give you a specific error. It gives like AAPT2 error.
If you want to know where the actual error is then
Follow step.
- Look at the panel which is at the right of your Android studio Check out the "Gradle" tab and click on it.
- You will see the "app" option. Click on it.
- In the app options you will see [Tasks -> build] click on it.
- Then you will get options list and see "assembleDebug" double click on it.
- Keep the patience and See build tab at the bottom panel of Android studios, you will get an exact error there what you made a mistake in which file and which position.
The error might be cause by non-ASCII symbols in gradle path. E.g. cyrillic symbols of the user folder. So, the problem is solved just by switching to another directory with ASCII-only path.