Error after updating Android Studio to version 3.0.1 [closed]

-1

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

  

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 failed for 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: p>

The activity_main.xml smartphone screen is not appearing as we've set up the apps interface

    
asked by anonymous 19.12.2017 / 13:38

1 answer

1

With version 3.0 of AndoridStudio, we have AAPT2 enabled by default on all projects.

This problem occurs in some projects prior to AS 3.0 when the Application Manifest is not properly structured. AAPT2 forces the manifest to follow a standard structure.

Then, check your application's AndroidManifest.xml and try to fix it. You can also refer to this Manifest file structure guide.

Basically, it should 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 does not work, you can disable AAPT2 in gradle.properties by adding / changing the line:

android.enableAapt2=false
    
19.12.2017 / 18:39