You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The v5.0.0-beta.1 version of the Unity SDK is causing crashes on multiple devices. We are not doing anything out of the ordinary, just using the SDK for standard push notifications. Our setup is to call: OneSignal.Default.Initialize("REMOVED_APP_ID");
After which we continue with the rest of our application logic.
From looking through the code, it would seem that the AppId has not been set, therefore it is crashing when trying to retrieve it inside the UpgradeReceiver when calling init.
We are unsure as to why the UpgradeReceiver is being called before our call to OneSignal.Default.Initialize though.
Steps to reproduce?
As described above all we are doing is installing the SDK and calling:
`OneSignal.Default.Initialize("REMOVED_APP_ID");`
After which we do check to see if we have permissions, if if not we do allow the app to request them once again based on some internal config.
What did you expect to happen?
It not crash. Users should be able to enable push notifications as normal.
Unity version
2021.3.18f1
OneSignal Unity SDK version
v5.0.0-beta.1
Platform
Android
Relevant log output
Here is a full stacktrace we have on Android: Caused by: java.lang.RuntimeException: Unable to start receiver com.onesignal.notifications.receivers.UpgradeReceiver: java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String at android.app.ActivityThread.handleReceiver (ActivityThread.java:4458) at android.app.ActivityThread.access$1700 (ActivityThread.java:261) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2165) at android.os.Handler.dispatchMessage (Handler.java:111) at android.os.Looper.loopOnce (Looper.java:238) at android.os.Looper.loop (Looper.java:357) at android.app.ActivityThread.main (ActivityThread.java:8090) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1026) Caused by java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String at com.onesignal.common.modeling.Model.getStringProperty (Model.kt:215) at com.onesignal.common.modeling.Model.getStringProperty$default (Model.kt:215) at com.onesignal.core.internal.config.ConfigModel.getAppId (ConfigModel.kt:12) at com.onesignal.user.internal.operations.impl.listeners.SubscriptionModelStoreListener.getAddOperation (SubscriptionModelStoreListener.kt:24) at com.onesignal.user.internal.operations.impl.listeners.SubscriptionModelStoreListener.getAddOperation (SubscriptionModelStoreListener.kt:15) at com.onesignal.core.internal.operations.listeners.ModelStoreListener.onModelAdded (ModelStoreListener.kt:36) at com.onesignal.common.modeling.ModelStore$addItem$1.invoke (ModelStore.kt:110) at com.onesignal.common.modeling.ModelStore$addItem$1.invoke (ModelStore.kt:110) at com.onesignal.common.events.EventProducer.fire (EventProducer.kt:40) at com.onesignal.common.modeling.ModelStore.addItem (ModelStore.kt:110) at com.onesignal.common.modeling.ModelStore.addItem$default (ModelStore.kt:98) at com.onesignal.common.modeling.ModelStore.add (ModelStore.kt:46) at com.onesignal.common.modeling.ModelStore.replaceAll (ModelStore.kt:81) at com.onesignal.common.modeling.IModelStore$DefaultImpls.replaceAll$default (IModelStore.kt:81) at com.onesignal.internal.OneSignalImp.createAndSwitchToNewUser (OneSignalImp.kt:396) at com.onesignal.internal.OneSignalImp.createAndSwitchToNewUser$default (OneSignalImp.kt:343) at com.onesignal.internal.OneSignalImp.initWithContext (OneSignalImp.kt:202) at com.onesignal.OneSignal.initWithContext (OneSignal.kt:196) at com.onesignal.notifications.receivers.UpgradeReceiver.onReceive (UpgradeReceiver.kt:47) at android.app.ActivityThread.handleReceiver (ActivityThread.java:4449)
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
What happened?
The v5.0.0-beta.1 version of the Unity SDK is causing crashes on multiple devices. We are not doing anything out of the ordinary, just using the SDK for standard push notifications. Our setup is to call:
OneSignal.Default.Initialize("REMOVED_APP_ID");
After which we continue with the rest of our application logic.
From looking through the code, it would seem that the AppId has not been set, therefore it is crashing when trying to retrieve it inside the UpgradeReceiver when calling init.
We are unsure as to why the UpgradeReceiver is being called before our call to
OneSignal.Default.Initialize
though.Steps to reproduce?
What did you expect to happen?
It not crash. Users should be able to enable push notifications as normal.
Unity version
2021.3.18f1
OneSignal Unity SDK version
v5.0.0-beta.1
Platform
Android
Relevant log output
Here is a full stacktrace we have on Android:
Caused by: java.lang.RuntimeException: Unable to start receiver com.onesignal.notifications.receivers.UpgradeReceiver: java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String at android.app.ActivityThread.handleReceiver (ActivityThread.java:4458) at android.app.ActivityThread.access$1700 (ActivityThread.java:261) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2165) at android.os.Handler.dispatchMessage (Handler.java:111) at android.os.Looper.loopOnce (Looper.java:238) at android.os.Looper.loop (Looper.java:357) at android.app.ActivityThread.main (ActivityThread.java:8090) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1026) Caused by java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String at com.onesignal.common.modeling.Model.getStringProperty (Model.kt:215) at com.onesignal.common.modeling.Model.getStringProperty$default (Model.kt:215) at com.onesignal.core.internal.config.ConfigModel.getAppId (ConfigModel.kt:12) at com.onesignal.user.internal.operations.impl.listeners.SubscriptionModelStoreListener.getAddOperation (SubscriptionModelStoreListener.kt:24) at com.onesignal.user.internal.operations.impl.listeners.SubscriptionModelStoreListener.getAddOperation (SubscriptionModelStoreListener.kt:15) at com.onesignal.core.internal.operations.listeners.ModelStoreListener.onModelAdded (ModelStoreListener.kt:36) at com.onesignal.common.modeling.ModelStore$addItem$1.invoke (ModelStore.kt:110) at com.onesignal.common.modeling.ModelStore$addItem$1.invoke (ModelStore.kt:110) at com.onesignal.common.events.EventProducer.fire (EventProducer.kt:40) at com.onesignal.common.modeling.ModelStore.addItem (ModelStore.kt:110) at com.onesignal.common.modeling.ModelStore.addItem$default (ModelStore.kt:98) at com.onesignal.common.modeling.ModelStore.add (ModelStore.kt:46) at com.onesignal.common.modeling.ModelStore.replaceAll (ModelStore.kt:81) at com.onesignal.common.modeling.IModelStore$DefaultImpls.replaceAll$default (IModelStore.kt:81) at com.onesignal.internal.OneSignalImp.createAndSwitchToNewUser (OneSignalImp.kt:396) at com.onesignal.internal.OneSignalImp.createAndSwitchToNewUser$default (OneSignalImp.kt:343) at com.onesignal.internal.OneSignalImp.initWithContext (OneSignalImp.kt:202) at com.onesignal.OneSignal.initWithContext (OneSignal.kt:196) at com.onesignal.notifications.receivers.UpgradeReceiver.onReceive (UpgradeReceiver.kt:47) at android.app.ActivityThread.handleReceiver (ActivityThread.java:4449)
Code of Conduct
The text was updated successfully, but these errors were encountered: