Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

com.pushwoosh.internal.network.e.sendRequest => RejectedExecutionException on startup #334

Closed tenglandct closed 4 years ago

tenglandct commented 4 years ago

Hi there,

We have a crash on start up of an app after an APK update that upgrades Pushwoosh Plugin version.

It appears to be happening a very small minority of devices and is bypassed with an uninstallation and reinstallation of the APK. However, this is affecting a large customer with several thousand devices provisioned by MDM (Soti) and having to manually install and uninstall the APK on even a small minority of these devices will cause them significant logistical issues. It is also happening on every startup after it starts happening, and appears (although I haven't got confirmation on this) to happen immediately on update of the APK

Fortunately they have a very homogenous device estate: Zebra TC51 - Android 7.1

Pushwoosh and Cordova versions, before and after:

PW: 7.13.0 => 7.18.3 Cordova-cli: 8.0.0 for both Cordova Android: 6.3.0 => 8.0.0

Stack Trace taken from crash log in Android Play Store:

java.lang.RuntimeException: 
  at android.app.LoadedApk$ReceiverDispatcher$Args.run (LoadedApk.java:1132)
  at android.os.Handler.handleCallback (Handler.java:751)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6123)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:889)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:779)
Caused by: java.util.concurrent.RejectedExecutionException: 
  at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:2049)
  at java.util.concurrent.ThreadPoolExecutor.reject (ThreadPoolExecutor.java:814)
  at java.util.concurrent.ThreadPoolExecutor.execute (ThreadPoolExecutor.java:1360)
  at android.os.AsyncTask.executeOnExecutor (AsyncTask.java:623)
  at com.pushwoosh.internal.network.e.sendRequest (Unknown Source)
  at com.pushwoosh.internal.network.e.sendRequest (Unknown Source)
  at com.pushwoosh.NetworkReceiver.onReceive (Unknown Source)
  at android.app.LoadedApk$ReceiverDispatcher$Args.run (LoadedApk.java:1122)

Are you able to help fix this issue, or offer any insight? It would be very gratefully received!

wfhm commented 4 years ago

@tenglandct,

The issue was already fixed in 5.19.6 version of our native Android SDK, however, the 7.18.3 version of the Cordova plugin uses 5.19.5 version of Android SDK:

https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/releases/tag/7.18.3

Just update to the latest plugin version and the issue should be fixed.

tenglandct commented 4 years ago

Brilliant! I did look through the release notes for both but I couldn't see anything that directly referenced the issue, but I presume this was the line about - Issues causing crashes in NetworkReceiver.

Thank you very much for the swift response @wfhm !