Skip to content
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

Android 8 crash with IllegalArgumentException in NotificationRestorer.startDelayedRestoreTaskFromReceiver #426

Closed
Talkless opened this issue Feb 5, 2018 · 4 comments

Comments

@Talkless
Copy link
Contributor

Talkless commented Feb 5, 2018

Hi,

Google Play Consle shows crashes on (currently all, there are few of them) Android 8 devices, such as Sony Xperia XZs (G8231) and Sony Xperia XZ1 (G8341):

java.lang.RuntimeException:  
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3264) 
  at android.app.ActivityThread.-wrap17 (Unknown Source) 
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1682) 
  at android.os.Handler.dispatchMessage (Handler.java:105) 
  at android.os.Looper.loop (Looper.java:251) 
  at android.app.ActivityThread.main (ActivityThread.java:6563) 
  at java.lang.reflect.Method.invoke (Native Method) 
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240) 
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)

Caused by: java.lang.IllegalArgumentException:  
  at android.os.Parcel.readException (Parcel.java:1965) 
  at android.os.Parcel.readException (Parcel.java:1898) 
  at android.app.job.IJobScheduler$Stub$Proxy.schedule (IJobScheduler.java:180) 
  at android.app.JobSchedulerImpl.schedule (JobSchedulerImpl.java:44) 
  at com.onesignal.NotificationRestorer.startDelayedRestoreTaskFromReceiver (NotificationRestorer.java:240) 
  at com.onesignal.UpgradeReceiver.onReceive (UpgradeReceiver.java:39) 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3257)

OneSignal 3.7.1

android:minSdkVersion="19" android:targetSdkVersion="27" android:maxSdkVersion="27"

This is Qt application with a workaround for #102 <service android:name="com.onesignal.SyncService" android:stopWithTask="true" /> (true), if that might be relevant.

@Talkless Talkless changed the title Android 8 crash with java.lang.IllegalArgumentException in com.onesignal.NotificationRestorer.startDelayedRestoreTaskFromReceiver Android 8 crash with IllegalArgumentException in NotificationRestorer.startDelayedRestoreTaskFromReceiver Feb 5, 2018
@Talkless
Copy link
Contributor Author

Talkless commented Feb 5, 2018

Before 3.7.1 update, (that was 3.5.1) there was different exception on Sony Xperia XZ1:

java.lang.RuntimeException:  
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3264) 
  at android.app.ActivityThread.-wrap17 (Unknown Source) 
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1682) 
  at android.os.Handler.dispatchMessage (Handler.java:105) 
  at android.os.Looper.loop (Looper.java:251) 
  at android.app.ActivityThread.main (ActivityThread.java:6563) 
  at java.lang.reflect.Method.invoke (Native Method) 
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240) 
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)

Caused by: java.lang.IllegalStateException:  
  at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1505) 
  at android.app.ContextImpl.startService (ContextImpl.java:1461) 
  at android.content.ContextWrapper.startService (ContextWrapper.java:644) 
  at android.content.ContextWrapper.startService (ContextWrapper.java:644) 
  at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService (WakefulBroadcastReceiver.java:91) 
  at com.onesignal.BootUpReceiver.onReceive (BootUpReceiver.java:42) 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3257)

@jkasten2
Copy link
Member

jkasten2 commented Feb 5, 2018

@Talkless Thanks for the crash reports.

Can you confirm that this crash is from the OneSignal 3.7.1 SDK and is from an Oreo device?

Caused by: java.lang.IllegalArgumentException:  
  at android.os.Parcel.readException (Parcel.java:1965) 
  at android.os.Parcel.readException (Parcel.java:1898) 
  at android.app.job.IJobScheduler$Stub$Proxy.schedule (IJobScheduler.java:180) 
  at android.app.JobSchedulerImpl.schedule (JobSchedulerImpl.java:44) 
  at com.onesignal.NotificationRestorer.startDelayedRestoreTaskFromReceiver (NotificationRestorer.java:240) 
  at com.onesignal.UpgradeReceiver.onReceive (UpgradeReceiver.java:39) 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3257)

SDK 3.7.1 NotificationRestorer.java:240 points to creating a pendingIntent which doesn't match up.

The com.onesignal.SyncService AndroidManifest.xml entry change would only effect crashes that have that class name in the stack trace. There are unrelated to the SyncService since they are not in any of those stack traces.

@Talkless
Copy link
Contributor Author

Talkless commented Feb 6, 2018

Can you confirm that this crash is from the OneSignal 3.7.1 SDK and is from an Oreo device?

Ugh, somehow I've managed to package 3.6.4 jar as if it was 3.7.1. Probably accidentally exacted older release download...

Sorry for the noise.

@Talkless Talkless closed this as completed Feb 6, 2018
@Talkless
Copy link
Contributor Author

Talkless commented Feb 6, 2018

@jkasten2 I believe your 3.7.1 .zip archive has OneSignalSDK.jar v3.6.4 jar inside. I can extract it and find "030604" string inside some .class file (using strings).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants