Error after updating Android Studio to version 3.0.1

Asked

Viewed 481 times

-1

Hello, I just updated my version from 2.1 to 3.0.1 and this error appears

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar] Error:java.util.Concurrent.Executionexception: com.android.tools.aapt2.Aapt2exception: AAPT2 error: check logs for Details Error:Execution for failed task ':app:mergeDebugResources'. > Error: java.util.Concurrent.Executionexception: com.android.tools.aapt2.Aapt2exception: AAPT2 error: check logs for Details Information:BUILD FAILED in 44s Information:2 errors Information:0 warnings Information:See complete output in console

The activity_main.xml smartphone screen that we set up the interface of the apps is not showing up

  • 3

    I’d focus on the part that says "check logs for Details", and perhaps in "See complete output in console".

1 answer

1

With version 3.0 of Andoridstudio, we have the AAPT2 enabled by default in all projects.

This problem happens in some projects prior to AS 3.0 when the application Manifest is not properly structured. AAPT2 requires the manifest to follow a standard structure.

So, check your application’s Androidmanifest.xml and try to fix it. You can also refer to this guide from structure of the manifest archive.

Basically, it must follow this structure (not all tags are required):

<?xml version="1.0" encoding="utf-8"?>

<manifest>

    <uses-permission />
    <permission />
    <permission-tree />
    <permission-group />
    <instrumentation />
    <uses-sdk />
    <uses-configuration />  
    <uses-feature />  
    <supports-screens />  
    <compatible-screens />  
    <supports-gl-texture />  

    <application>

        <activity>
            <intent-filter>
                <action />
                <category />
                <data />
            </intent-filter>
            <meta-data />
        </activity>

        <activity-alias>
            <intent-filter> . . . </intent-filter>
            <meta-data />
        </activity-alias>

        <service>
            <intent-filter> . . . </intent-filter>
            <meta-data/>
        </service>

        <receiver>
            <intent-filter> . . . </intent-filter>
            <meta-data />
        </receiver>

        <provider>
            <grant-uri-permission />
            <meta-data />
            <path-permission />
        </provider>

        <uses-library />

    </application>

</manifest>

If it still doesn’t work, you can disable AAPT2 on Gradle.properties adding/changing the line:

android.enableAapt2=false
  • Perfect, thank you so much for adding the android code.enableAapt2=false worked

  • I am happy to know that I could help. But I would like to stress that this solution does not solve the problem, it just hides it. I recommend that you seek to know more about AAPT2 and try to definitively correct this failure.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.