Error in debug \ AndroidManifest.xml ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error

2

Today I was adding the firebase functions from the wizard and at the time of doing the gradle build I got an error in the file debug \ AndroidManifest.xml , before to add the functions of firebase I compiled without problems, I attached the file debug \ AndroidManifest.xml and the errors they give me.

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

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="26" />

<br />

<uses-permission android:name="android.permission.INTERNET" />

<br />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<permission
    android:name="gerard.laxarxa.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name="gerard.laxarxa.permission.C2D_MESSAGE" />

<application
    android:allowBackup="true"
    android:debuggable="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <activity android:name="gerard.laxarxa.account" />
    <activity android:name="gerard.laxarxa.register" />
    <activity
        android:name="gerard.laxarxa.login"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="android.support.VERSION"
        android:value="26.1.0" />

    <service
        android:name="com.google.firebase.messaging.FirebaseMessagingService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <receiver
        android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
        android:enabled="true"
        android:exported="false" >
    </receiver>
    <receiver
        android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
        android:enabled="true"
        android:exported="true"
        android:permission="android.permission.INSTALL_PACKAGES" >
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

    <service
        android:name="com.google.android.gms.measurement.AppMeasurementService"
        android:enabled="true"
        android:exported="false" />
    <service
        android:name="com.google.android.gms.measurement.AppMeasurementJobService"
        android:enabled="true"
        android:exported="false"
        android:permission="android.permission.BIND_JOB_SERVICE" />

    <activity
        android:name="com.google.android.gms.appinvite.PreviewActivity"
        android:exported="true"
        android:theme="@style/Theme.AppInvite.Preview" >
        <intent-filter>
            <action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.google.android.gms.common.api.GoogleApiActivity"
        android:exported="false"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />

            <category android:name="gerard.laxarxa" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
        android:exported="false" />

    <service
        android:name="com.google.firebase.iid.FirebaseInstanceIdService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

    <provider
        android:name="com.google.firebase.provider.FirebaseInitProvider"
        android:authorities="gerard.laxarxa.firebaseinitprovider"
        android:exported="false"
        android:initOrder="100" />

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data
        android:name="android.arch.lifecycle.VERSION"
        android:value="27.0.0-SNAPSHOT" />
</application>

  

Error: (11) error: unknown element
found.   Error: (15) error: unknown element
found.   Error: (11) unknown element
found.   Error: (15) unknown element
found.   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

    
asked by gery_08 01.11.2017 в 22:36
source

2 answers

1

The commented error,:

  

Error: java.util.concurrent.ExecutionException:   java.util.concurrent.ExecutionException:   com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for   details

implies that there is usually a problem in the configuration of your project, in this case the visible problem is your AndroidManifest.xml , you should not add <br /> , within the configuration defined in the file.

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="26" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>

<permission
    android:name="gerard.laxarxa.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name="gerard.laxarxa.permission.C2D_MESSAGE" />

<application
    android:allowBackup="true"
    android:debuggable="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <activity android:name="gerard.laxarxa.account" />
    <activity android:name="gerard.laxarxa.register" />
    <activity
        android:name="gerard.laxarxa.login"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="android.support.VERSION"
        android:value="26.1.0" />

    <service
        android:name="com.google.firebase.messaging.FirebaseMessagingService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <receiver
        android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
        android:enabled="true"
        android:exported="false" >
    </receiver>
    <receiver
        android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
        android:enabled="true"
        android:exported="true"
        android:permission="android.permission.INSTALL_PACKAGES" >
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

    <service
        android:name="com.google.android.gms.measurement.AppMeasurementService"
        android:enabled="true"
        android:exported="false" />
    <service
        android:name="com.google.android.gms.measurement.AppMeasurementJobService"
        android:enabled="true"
        android:exported="false"
        android:permission="android.permission.BIND_JOB_SERVICE" />

    <activity
        android:name="com.google.android.gms.appinvite.PreviewActivity"
        android:exported="true"
        android:theme="@style/Theme.AppInvite.Preview" >
        <intent-filter>
            <action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.google.android.gms.common.api.GoogleApiActivity"
        android:exported="false"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />

            <category android:name="gerard.laxarxa" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
        android:exported="false" />

    <service
        android:name="com.google.firebase.iid.FirebaseInstanceIdService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

    <provider
        android:name="com.google.firebase.provider.FirebaseInitProvider"
        android:authorities="gerard.laxarxa.firebaseinitprovider"
        android:exported="false"
        android:initOrder="100" />

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data
        android:name="android.arch.lifecycle.VERSION"
        android:value="27.0.0-SNAPSHOT" />
</application>

It is important to comment that the file AndroidManifest.xml that you must edit in your project must be found within the path src\main\AndroidManifest.xml .

If you choose to visualize your project as " Android ", here is your AndroidManifest.xml

If you choose to visualize your project as " Project ", here is your AndroidManifest.xml

    
answered by 02.11.2017 / 00:11
source
0

The problem, according to this answer from OS in English , is that AAPT2 is stricter when evaluating the file Manifest .

I have tried to order your file, following the structure indicated by Android , since for example, there were some meta tags that were not inside their corresponding element.

Anyway, review it, lest I have put some meta tag inside another element ... what I have done has been to put them inside the previous element ... assuming they belonged to him, but they were out.

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

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="gerard.laxarxa.permission.C2D_MESSAGE" />

<permission
    android:name="gerard.laxarxa.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="26" />

<application
    android:allowBackup="true"
    android:debuggable="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <activity android:name="gerard.laxarxa.account" />
    <activity android:name="gerard.laxarxa.register" />
    <activity
        android:name="gerard.laxarxa.login"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    <meta-data
        android:name="android.support.VERSION"
        android:value="26.1.0" />
    </activity>

    <service
        android:name="com.google.firebase.messaging.FirebaseMessagingService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <receiver
        android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
        android:enabled="true"
        android:exported="false" >
    </receiver>

    <receiver
        android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
        android:enabled="true"
        android:exported="true"
        android:permission="android.permission.INSTALL_PACKAGES" >
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

    <service
        android:name="com.google.android.gms.measurement.AppMeasurementService"
        android:enabled="true"
        android:exported="false" />

    <service
        android:name="com.google.android.gms.measurement.AppMeasurementJobService"
        android:enabled="true"
        android:exported="false"
        android:permission="android.permission.BIND_JOB_SERVICE" />

    <activity
        android:name="com.google.android.gms.appinvite.PreviewActivity"
        android:exported="true"
        android:theme="@style/Theme.AppInvite.Preview" >
        <intent-filter>
            <action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <activity
        android:name="com.google.android.gms.common.api.GoogleApiActivity"
        android:exported="false"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />

            <category android:name="gerard.laxarxa" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
        android:exported="false" />

    <service
        android:name="com.google.firebase.iid.FirebaseInstanceIdService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

    <provider
        android:name="com.google.firebase.provider.FirebaseInitProvider"
        android:authorities="gerard.laxarxa.firebaseinitprovider"
        android:exported="false"
        android:initOrder="100" > 

        <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

        <meta-data
        android:name="android.arch.lifecycle.VERSION"
        android:value="27.0.0-SNAPSHOT" />
       </provider>

</application>

</manifest>
    
answered by 01.11.2017 в 23:10