'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.'
Hi there. I'm working on an update to an already-published app on the Google Play Store. After working on my game for a while, I uploaded my .aab build to Google Play Internal Testing, only to have my file rejected by an error saying I didn't set any android:exported properties.
Can anyone help me with this? I think it's an issue with my manifest.xml, but I'm not even certain about that. Even advice on how to start troubleshooting would be awesome!
I've uploaded many builds to Google Play, even ones with more features than this, and this is the first time I've gotten this error.
Thanks!
Platform: Android Unity Version: 2020.3.16f1 Features in my game that may effect this(?): Unity Analytics, Google Play Games Achievements, Leaderboards, and Save Game, Google AdMob, and a plugin called "EasyMobile" from the Unity Asset Store
Full error (as seen in screenshot below): "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. See: developer.android.com/about/versions/12/behavior-changes-12#exported"
Sidenote: I don't know how formatting works. Apparently hitting enter for a new line doesn't work? If someone is able to edit it I'd appreciate that!
Article to Fix Error You uploaded an APK or Android App Bundle which has an activity : https://forum.unity.com/threads/not-able-to-publish-on-google-play-android-exported-android-12.1224948/#post-7870258
Answer by PamirKhan · Jan 13 at 12:35 PM
@kingzustin I build my game using Unity 2020.3.24.f1 I got same error when i was uploading my game to play store so i search online and found out that you have to made the following changes to your app in unity if you want to build for android 12.
Project Settings > Player > Android > Publishing Settings > Build, select Custom Main Manifest. Apply the following changes to Assets/Plugins/Android/AndroidManifest.xml:
If present, remove the following comment at the top of the file:
Add the android:exported attribute to the tag:
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
Source: https://developers.google.com/ar/develop/unity-arf/android-12-build
Unfortunately solution did not work out for me. So i simply download a newer version Unity 2020.3.25.f1 of unity and there was no error in uploading my game to google play store. It looked like they have fixed that issue in newer version of unity. I hope this will help you resolve your issue.
Best regards Limitless Games Pamir Khan
Thanks! Doing the custom manifest did NOT work for me, but updating the Unity version did!
i have waste 7 hours of my life, and this FINALLY fixed the problem, I LOVE YOU
Answer by segant · Jan 13 at 04:13 PM
Same problem.
I'm using 2021.1.0b3. Still same. I have to use new shadergraph.
Hmm okay, strange then. Maybe this fix was put in since creating the Unity Beta version. However, I don't know and don't know how to fix it... sorry :(
Answer by Voxel-Busters · Jan 14 at 06:52 AM
Most likely the issue is not having exported flag for the unity activity which is a requirement from Android 12. This can be solved by updating your unity to latest version.
BUT,
If you can't update or if unity hasn't back-ported to your LTS version, you can try the script listed here.
Note that this is picked from our plugin Cross Platform Native Plugins : Essential Kit and adapted to avoid any compilation errors for other who don't have the plugin. So, if you already have this plugin, nothing to add.
How to use?
1. Copy the below script and place it in any Editor folder
2. Make apk/aab and upload
[3]: http://u3d.as/1szE
I added this script in Assets/Editor path. But after build and uploaded to playstore i got same error. I'm using 2022.1.0b3
If it still doesn't work, it means you have other plugins which haven't added exported flag. Try updating those plugins or contact the asset publisher for the same.
Answer by magsoftware · Jan 17 at 01:33 PM
Adding android:export in my AndroidManifest doesn't work but I've found another solution for the moment.
In PlayerSettings -> Others I've changed Target API level from 'Automatic(highest installed)' to Android 11 ( API level 30 ) . If you do not have API 30 installed, use Android Studio -> Tools -> SDK Manager and install it.
If an error still appear when you want to build, go to C: -> Users -> YourUser -> AppData -> Local -> Android -> SDK -> Platforms and select 'android-30' folder.
Copy that folder to C:\Program Files\Unity\Hub\Editor\2021.1.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms
Restart unity and try to build again.
I know this is not a good solution for building for Android 12 but I'm using it to build just for other versions for the moment.
Cheers!
Answer by Brownberrygames · Jan 18 at 06:51 PM
This worked for me:
-Updated the unity version from 2019.4.21 to 2020.3.19. Then follow Project Settings > Player > Android > Publishing Settings > Build, select Custom Main Manifest -Added android:exported attribute to the activity tag in Main Manifest
Resolve Dependencies and build, after that I was able to update my game on playstore.
Your answer
Follow this Question
Related Questions
Google Play Game services Resolution Exception with newer Google Repository version 2 Answers
Prompt, please, as the data is being transferred to Google Play services? 0 Answers
Android Unable to merge android manifest Error 1 Answer
Android Build crahes after submitting to play store 0 Answers
Failed authenticating with google play services on android 0 Answers