OneSignal-Android-SDK
OneSignal-Android-SDK copied to clipboard
com.onesignal.shortcutbadger.ShortcutBadger.initBadger:200 SecurityException
I see many fatal crashes from a single rooted device. Firebase report:
Fatal Exception: java.lang.SecurityException Neither user 10064 nor current process has android.permission.SET_PREFERRED_APPLICATIONS.
Device Brand:Rockchip Model:VENUS RAM free: 2.72 GB Disk free: 23.26 GB Operating System Version:Android 11 Rooted:Yes
com.onesignal.shortcutbadger.ShortcutBadger.initBadger (ShortcutBadger.java:200) com.onesignal.shortcutbadger.ShortcutBadger.applyCountOrThrow (ShortcutBadger.java:91) com.onesignal.BadgeCountUpdater.updateCount (BadgeCountUpdater.java:122) com.onesignal.OneSignal.handleAppIdChange (OneSignal.java:906) com.onesignal.OneSignal.init (OneSignal.java:815) com.onesignal.OneSignal.setAppId (OneSignal.java:693) com.onesignal.OneSignal.reassignDelayedInitParams (OneSignal.java:1127) com.onesignal.OneSignal.onRemoteParamSet (OneSignal.java:845) com.onesignal.OneSignal$6.complete (OneSignal.java:1068) com.onesignal.OneSignalRemoteParams.processJson (OneSignalRemoteParams.java:206) com.onesignal.OneSignalRemoteParams.access$100 (OneSignalRemoteParams.java:12) com.onesignal.OneSignalRemoteParams$1.onSuccess (OneSignalRemoteParams.java:151) com.onesignal.OneSignalRestClient$5.run (OneSignalRestClient.java:269)
Additional info: classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.4' implementation 'com.onesignal:OneSignal:4.6.0'
// OneSignal Initialization OneSignal.initWithContext(this) OneSignal.setAppId(...)
@SuperBuper Thanks for reporting with the full stack trace. I am not sure why this specific device only would have this issue. However since Android 8 has notification categories / channels which is the official way to support badges now ShortcutBadger doesn't need to be used
The solution to this is the OneSignal SDK can omit calling ShortcutBadger if the device is running Android 8 or newer.
Hi, I would make an assumption that is a tv box, not a mobile device...