You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without the ‘an

According to google new policy If your app targets Android 12 or higher and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported: true attribute for these app components.

FOR FLUTTER AND REACT NATIVE PROJECTS :
add this line to AndroidManifest.xml file of project :

android:exported="true"

enter image description here

Now just rebuild your project. In most of the cases this work like a charm.

If above solution is not working or if your project is in Android Native follow the below instructions :
In the main manifest file check all the activities, services, and receivers that can use intent-filter which are without the android: exported tag.
Add android:exported=”true” or android:exported=”false” for these tags.

You might ask when I need to add android:exported=”true” or android:exported=”false” to the activities, services, or broadcast receivers that use intent filters. If the app component includes the LAUNCHER category, set android: exported to true otherwise set android: exported to false.

If adding the android: exported in the main manifest file not works for you follow the below steps:

  • open AndroidManifest.xml file and at the bottom select Merged Manifest.
    like this : enter image description here

  • if you are not able to preview Merged Manifest then in your build.gradle file
    set compileSdkVersion 30 and targetSdkVersion 30 and sync your project and now try to open the merged manifest again I hope this time you will have a proper preview of the merged manifest. but if there is no preview don’t worry you can still navigate to individual manifest files from different third-party libraries you have used in your project.

  • Note: also check individual third-party library manifest files if there is any activity, service, or receiver using then you have to override the same activity, service, or receiver in your main manifest file with android: exported property.

For Example in my case I have defined android: exported for each and every activity, service, or receiver in my main manifest file but in my project, I was using Razorpay dependency so in the manifest of Razorpay I found that there is an activity and receiver which are using property without android: exported so I declared them in my main manifest files.
as shown below :

 <activity
        android:name="com.razorpay.CheckoutActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:theme="@style/CheckoutTheme"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <data
                android:host="rzp.io"
                android:scheme="io.rzp" />
        </intent-filter>
    </activity>

    <receiver android:name="com.razorpay.RzpTokenReceiver"
        android:exported="true"
        android:permission="android.permission.INTERNET">
        <intent-filter>
            <action android:name="rzp.device_token.share" />
        </intent-filter>
    </receiver>

Note: in your case, you may have to go through more files and check activity, and services, and mention them in your main manifest file.

  • also after doing all this you can change back to targetSdkVersion 31 and compileSdkVersion 31 in your build.gradle file.

Leave a Comment