-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OneSignal 3.0.3 not compatible with Android 12 (API 31) #528
Comments
Having the same issue with SDK 3.0.3 and Unity 202.3.23f1 If i export the project and open it in android studio it points at the specific file: Merging Errors: Error: android:exported needs to be explicitly specified for element <receiver#com.onesignal.GcmBroadcastReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for |
[temp solution] Just add below lines inside in global AndroidManifest.xml |
Thank you for reporting, I was unable to reproduce your issue. Could you provide an example repo with steps to reproduce and also provide your application's AndroidManifest.xml file? |
I have the same problem but @PrisedRabbit solution is not working for me. |
This is fixed in version 3.0.3 you may need to add the following to your main AndroidManifest file (under Assets/Plugins/Android) to prevent exceptions upon receiving a push notification, or to be able to upload to Play Store successfully:
The following is a workaround for older versions, but may not work for you. I leave it here because it can be useful to some people. If you don't want to upgrade, and want to use a workaround for the older version, add these to the AndroidManifest.xml file in Assets/Plugins/Android/AndroidManifest.xml:
|
Hi @roointan, i used your code suggestion i could make a build, But the notification is not receiving, but if i make a build with the older sdk i could receive the notification(Just for your info that onesignal is configured correct). Can you guide me ? Thank you |
Hello! Unfortunately not, I used the latest SDK myself. I edited the comment so it's not misleading. |
I use the version 3.0.5 with unity and i'm facing the same. @roointan please how did you do finally ? |
@GaneshMBabu21 where did you add the code ? I added in the main manifest but got the |
use version 3.0.3, from asset store |
I resolved using onesignal 3.0.3 (I don't know if this workaroung works with 3.0.5 either), and modifying my custom LauncherManifest.xml in this way:
|
this works! just take care: MUST put this content into the project AndroidMenifest.xml. NOT the one signal plugin manifest. Seem like the one signal dynamically append these into the manifest when android build, because even in the gradle output I can see the exported tag added to all element, but still does not work. So OneSignal plugin MUST do some magic when building abb from Gradle output. Therefore, I guess after adding this content to the manifest, the Plugin cannot override it. Btw, it work in old version even v2 |
Update: the workaround is updated |
Thanks, it works now. |
add xmlns:tools="http://schemas.android.com/tools" after xmlns:android="http://schemas.android.com/apk/res/android" also it works for me ty |
Thanks. Works for me. |
Description:
I updated my project with the last OneSignal Unity SDK but I cannot build it for Android 12 because Google rejects my app bundle. It says that android:exported is missing somewhere. If I check the OneSignal manifests in my project there isn't this line of code, and I don't know how to add it.
Environment
OneSignal SDK 3.0.3
Unity 2020.3.17f1
Steps to Reproduce Issue:
The text was updated successfully, but these errors were encountered: