skip to Main Content

Right now I am trying to build my appbundle in flutter using the following command:

flutter build appbundle --release

and receive the following error:

 Manifest merger failed : android:exported needs to be explicitly specified for <receiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

I have run with stack trace, info and debug and nothing useful comes out of it.

and after trying many solutions, mostly removing packages or manually adding android:export="true", any push in the right direction would be greatly appreciated.

I tried to run flutter build appbundle and expected an app bundle file to be generated. This works for sdk version 30 and target version 30, but at 31 I get the error previously stated.

2

Answers


  1. Chosen as BEST ANSWER

    I noticed that the problem was due to the fact I did not have this receiver

       <receiver
        android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>
    

    There was no receiver set for this specific package in the AndroidManifest.xml file


  2. You need to add

    android:exported="true"
    

    in ./android/app/src/main/AndroidManifest.xml

    in activity section near

    android:name=".MainActivity"
    

    it will look like this

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="">
        <uses-permission android:name="android.permission.INTERNET"/>
       <application
            android:label=""
            android:name="${applicationName}"
            android:icon="@mipmap/ic_launcher">
            <activity
                android:name=".MainActivity"
                android:exported="true"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search