I reaslied today that I can’t update my game anymore. The error I get is: “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: Behavior changes: Apps targeting Android 12 | Android Developers”
Updated Unity version to 2020.3.25.f1 - same error
With 2020.3.25.f1 and 2019.4.28f1 → I’ve selected “Custom Main Manifest” (Project Settings > Player > Android > Publishing Settings > Build), and added android:exported=“false” (one time) and android:exported=“true” (another time) in AndroidManifest.xml → but still same error
Does anyone know any other method that will fix the error and allow me to update the game? I have Target API Level: 32.
Send me a dummy apk (with all scenes removed from the build settings) to have a look.
Most likely you may have other plugins which needs to add exported flag to manifest.
Thank you for your reply! I have sent an e-mail onto support@voxelbusters.com with an explanation and with the dummy apk you asked for (didn’t want to share it through here).
So, the issue is that Google doesn’t let publishing an app bundle because of this android:exported flag.
What I’ve made so far:
Made a Custon Main Manifest and added android:exported=“true” inside the .
I’ve also updated my Unity to the latest version.
I “implemented” your script (it’s inside the Editor subforlder).
I have a NativeShare plugin as well. I have no idea how to add the exported flag onto this plugin and I’m not even sure if that’s causing the issue.
However, I found out that everytime I am building an apk or an app bundle, an AndroidManifest.xml get’s created which has it’s android:exported set to false (see in the screenshot I’ve attached).
Could it be, that I have to set each or one of these to true instead? Which ones?
And most importantly: how? Do I have to copy this and make a Custom Gradle Temlate and then copy all this inside with setting these exported flags to true? If yes, which one of the Gradle Templades do I have to create? There’s a bunch of options for that inside Unitys Player Settings > Publishing Settings > Build.
Try to create a new empty project, build it and see if the issue is reproducible. If it is not reproducible, add the NativeShare plugin and see if the issue becomes reproducible. Most likely that plugin adds its own activity, activity alias, service or broadcast receiver with intent filter which does not specify android:exported property. You will have to look for a new plugin version which has this fixed.
I expect this issue will be caused by the plugin, because you use Unity 2020.3.25.f1 which already adds android:exported property for Unity activity.
android:exported property is specified for Unity activity starting with these versions: 2019.4.33f1, 2020.3.22f1, 2021.1.20f1 and 2021.2.0b11.
When I create a new custom main manifest in 2020.3.26f1 (and I believe also 2021.2.8f1) the generated AndroidManifest.xml does not contain the android:exported property.
Well, the NativeShare is causing the issue, I’m pretty sure. It has it’s android:exported set to false. I tried to override it with a Custom Main Mainfest (copy-pasted and changed from false to true) but that is somehow not merging.
Isn’t there any other solution than removing this plugin? Can’t I somehow set it to true instead of implementing a whole another plugin?
If it’s necesseraly, can you suggest me any other, which has been already updated?
Thank you so-so much for helping me with that!
I have never thought, not even for a second that Unitys “dedicated” package is going to cause this issue…
I deleted it and all the referred codes, now it works. I also found an asset in the store which has an update for Android 12, implementing that.
No, it gets added during the build, so the manifest template in Unity project’s Plugins/Android will not have it, but the manifest in the exported gradle project (or built app) will have it.
Hello!
I got the same error: “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: Behavior changes: Apps targeting Android 12 | Android Developers”.
But I don’t have the mobile notifications plugin installed.