Android Studio 3.0 issue


I just upgraded to Android Studio 3.0 mid-way through chapter 13, after completing listing 13.7. Now I get a build error related to fragment_crime_list.xml:

Error:error: attribute 'res-auto:showAsAction' not found.
Error:attribute 'res-auto:showAsAction' not found.
Error:failed linking file resources.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: AAPT2 error: check logs for details AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
Failed to execute aapt

This is the relevant code:
<?xml version="1.0" encoding="utf-8"?>


I found a bunch of suggested fixes on S.O. but nothing that really solves or explains why this is happening. Any ideas?


I think, this line is your problem.

failed linking file resources.

AAPT (Android Asset Packaging Tool ) can compile resources. I think you should look at this.
I assume that your gradle is version 3.0.0. You can try,

android.enableAapt2=false in your file and restarting the Gradle.

I’m using android studio 3.0. But I don’t use the above code.Because I didn’t encounter this the problem.
Or you can check newly released.
And check this and this.

Android Studio 3.0

I tried setting enableAapt2 to false, and it still had errors.

Then I looked back at the code and realized I had made a mistake in the XML. What I typed:

And the correct way:

Thanks for the response :slight_smile:


Thanks a lottttttttttttttttttttttttttttttttttt…
Saved my hours…
it’s work for me…
it’s correct answer of aapt error…