This is the output of my Gradle console, I am unable to build my project
D:\Android Projects\....\app\src\main\res\layout\topic_view_header.xml
Error:error: resource attr/?? (aka -packagename- :attr/??) not found.
Error:error: resource attr/?? (aka -packagename-:attr/??) not found.
Error:error: resource attr/?? (aka -packagename-:attr/??) not found.
Error:resource attr/?? (aka -packagename-:attr/??) not found.
Error:resource attr/?? (aka -packagename-:attr/??) not found.
Error:resource attr/?? (aka -packagename-:attr/??) not found.
Error:failed linking file resources.
Error:java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 27s
Information:11 errors
Information:0 warnings
Android Studio 3.0 RC 2
Aapt2 is enabled by default when you use android plugin for gradle 3.0.
This is to
as stated here.
But if you are facing issues with it, you can switch back to previous version by adding this in
gradle.properties
android.enableAapt2=false
Update:
Non-ascii characters issues have been fixed in AAPT2 and android gradle plugin now (yay!). Instead of disabling AAPT2 now you can just use android gradle plugin version 3.2.0-alpha11 or newer and you should not encounter this error anymore.
The Resource Exception means there is an error with your resources, any resource folder file is corrupted, try to open all images in drawable folder to see if these are opening fine.
There is a good command to check for corrupted resource pngs.
Looks like a resources related error. I would start there.
I got this ("Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details") first time related to pictures. Resize solved it. Or another time just repaired the links to resources.
Disabling the AAPT2 mght cause issue in further development, In my case the error was generated when I created the app icon.
I solve it by removing this line
I tried everything suggested on here and many other sites, I eventually figured out that the problem was with Bitdefender blocking aapt....
If you have Bitdefender installed then you need to turn aapt & aapt2 "Application Access" on individually.
Hope this is of use.
Check if any of your new XML files has an issue. Go to Android issues and see if there are XML files there. However, the error doesn't show on the right XML file that has the problem.
In my case, I added two headers in the same XML file.
Something like that: