'uploaded an APK which has an activity,activity alias,service or broadcast receiver with intentfilter, but without 'android : exported' property set
I'm having an issue when i'm uploading app bundle to the play console that You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. but my manifest file includes the property.
Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="**********">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="*****"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_artboard_1" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="Z*********"/>
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="im.mingguang.mingguang_app.flutter_downloader.provider"
android:grantUriPermissions="true"
android:requestLegacyExternalStorage="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Play Console Error

Solution 1:[1]
I solved by writing
android:exported="true"
in activity below the android:name=".MainActivity"

Solution 2:[2]
On our about the 11th of January, the Play Store introduced a lint check when uploading APKs to verify exported attributes are set correctly in the manifest.
Tools like DexGuard that obfuscate attribute names will cause the Play Store linter to fail, since it will be unable to check for exported attributes.
To fix this, configure obfuscation tools to keep attribute names in the manifest.
Here is the rule we used for DexGuard:
-keepresourcexmlattributenames manifest/**
Solution 3:[3]
In Your manifest file check all the activities, services , receiver that uses intent-filter without android:exported tag. In your main manifest file you can simply add android:exported property to activity tag so add android:exported="" and set a boolean value inside these quotation marks. Now you might ask when do 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. In most other cases, set android:exported to false.
Note : also check individual third party library manifest files if there is any activity , service or receiver using then you have to override same activity , service or receiver in your main manifest file with android:exported property.
for more explanation you can refer to my answer on same problem.
Solution 4:[4]
its_broke_again's answer works perfectly for me. I'm describing the steps to make things a little easier.
1. Enter the following commands on terminal
flutter pub upgrade --major-versions
flutter clean
flutter build appbundle
2. Add android:exported="true" on AndroidManifest.xml
<activity
android:name=".MainActivity"
android:exported="true"
...
</activity>
Solution 5:[5]
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 attribute for these app components.
If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false.
The following code snippet shows an example of a service that contains an intent filter whose android:exported attribute is set to false:
<service android:name="com.example.app.backgroundService"
android:exported="false">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</service>
<receiver android:name="com.example.app.serives.SilentPushReceiver"
android:exported="false">
<intent-filter>
<!-- Receive silent push notifications. -->
<action
android:name="uz.usoft.kidya.action.ymp.SILENT_PUSH_RECEIVE"/>
</intent-filter>
</receiver>
<activity android:name="com.example.app.SplashScreenActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.app.MainActivity"
android:exported="false"/>
About info: https://developer.android.com/about/versions/12/behavior-changes-12#exported
Solution 6:[6]
I faced the same problem nothing posted seems to fix it
so I downgraded build.gradle targetSdkVersion 30 and compileSdkVersion 30
it should work fine
in my case geocoding was the package witch caused the problem So it wouldn't build with the 30 SdkVersion so I had to deleted the exception witch refers to Android S "API 31"
Solution 7:[7]
For Flutter: If you changed AndroidManifest and you still face the same error, the problem is caused by a package. To identify the package, in search for <intent-filter in "build" folder, then find and <intent-filter has parent without android:exported="true/false" Then you should upgrade the package. if you are using the latest version, then you need to contact the package developer, or clone it and use your GitHub version.
Solution 8:[8]
For me, adding android:exported="true" to MainActivity was not enough.
but I also had to remove the huawei agcp and hms for push notification to let it work.
it seems that it uses an activity, activity alias, service or broadcast without android:exported
Solution 9:[9]
Android manifest file highlights the error, generally wherever we have used intent filter, it requires us to set the attrbute android:exported="true"
The default activity should be set as "true" rest all can be set either "true" or "false" depending on wether we want other apps to fire our activity/service
Solution 10:[10]
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 attribute for these app components.
Warning: If an activity, service, or broadcast receiver uses intent filters and doesn't have an explicitly-declared value for android:exported, your app can't be installed on a device that runs Android 12 or higher. If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false.
The following code snippet shows an example of a service that contains an intent filter whose android:exported attribute is set to false:
<service android:name="com.example.app.backgroundService"
android:exported="false">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
Solution 11:[11]
I had the same error and for 2 days I was trying to fix it.
Firstly, android:exported="true" did not work for me because I added to only one activity.
- I updated the unity version (not worked at that time, maybe has an effect)
- I added
android:exported="true"in every activity field than voula it works.
My unity game looks like now :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.unity3d.player" android:installLocation="preferExternal" tools:ignore="MissingLeanbackSupport">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<uses-feature android:glEsVersion="0x00020000" />
<application android:name="androidx.multidex.MultiDexApplication" android:fullBackupContent="false" android:allowBackup="false" android:theme="@android:style/Theme.NoTitleBar" tools:ignore="GoogleAppIndexingWarning,MissingTvBanner" tools:replace="fullBackupContent,allowBackup">
<!-- UNITY -->
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:resizeableActivity="false" android:hardwareAccelerated="false" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data android:name="android.notch_support" android:value="true" />
</activity>
<!-- FULLSCREEN FIX -->
<meta-data android:name="android.max_aspect" android:value="2.16" />
<!-- 3rdParty MANIFEST -->
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityGamingServicesFriendFinderActivity" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityGameRequestActivity" android:exported="true"/>
<activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity" android:exported="true"/>
<activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity" android:exported="true"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb901505887229125" />
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="true" />
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="true" />
<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider901505887229125" android:exported="true" />
<meta-data android:name="unity.splash-mode" android:value="0" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<meta-data android:name="unity.allow-resizable-window" android:value="False" />
<meta-data android:name="notch.config" android:value="portrait|landscape" />
<meta-data android:name="unity.build-id" android:value="31d4e179-c52c-49d7-a4f5-da548e453521" />
<receiver android:name="com.unity.androidnotifications.UnityNotificationManager" android:exported="true" />
<receiver android:name="com.unity.androidnotifications.UnityNotificationRestartOnBootReceiver" android:exported="true" android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
<uses-feature android:name="android.hardware.vulkan.version" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
You can see android:exported="true" added in every activity and receiver.
Solution 12:[12]
Need to change all the library used in pubspec.yaml to updated version wheather they are used the 'exported' in manifiest file.
Solution 13:[13]
In my flutter app, I just had to change 1 line in in android/app/src/main/AndroidMainfest.xml.
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true"> //added this line
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Also, I am using compileSdkversion 31 and targetSdkVersion 31.
Solution 14:[14]
Reading the doc : https://developer.android.com/about/versions/12/behavior-changes-12#exported, it looks like 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 property for these app components.
If your app si small you might just need to add the android:exported property in the AndroidManifest.xml for every nodes using intent-filter.
But if you're using many external dependencies, modifying only the main manifest file might be not enough.
You might need to do it for every third parties library that you have in your project, that contains an intent-filter node without the android:exported property.
You can find the list of all the activity, activity alias, service or broadcast into the merged manifest.
If you cannot find it using AndroidStudio:
- Downgrade
targetSdkVersion: 30andcompileSdkVersion: 30in thebuild.gradleto be able to build.- Build the project on an android device
- Then you can check the merged manifest into
/project_name/build/app/intermediates/merged_manifests/debug/out/AndroidManifest.xml.
Now you can check every individual third party library where the android:exported is missing. And declare them explicitly in the main manifest file.
Then you can change back to targetSdkVersion: 31 and compileSdkVersion: 31 and check if it is working.
Solution 15:[15]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow


