katzer / cordova-plugin-background-mode

Keep app running in background
Apache License 2.0
1.38k stars 1.03k forks source link

got `IllegalArgumentException` exception #287

Open achmadk opened 7 years ago

achmadk commented 7 years ago

Excuse me, Mr. @katzer . I use your plugin to play or stop audio files in my game project. Almost users who installed that game get IllegalArgumentException. This is one of the stack trace reported from Google Play console.

java.lang.RuntimeException: 
  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3056)
  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3085)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1325)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:136)
  at android.app.ActivityThread.main(ActivityThread.java:5584)
  at java.lang.reflect.Method.invokeNative(Native Method:0)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
  at dalvik.system.NativeStart.main(Native Method:0)
Caused by: java.lang.IllegalArgumentException: 
  at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:922)
  at android.app.ContextImpl.unbindService(ContextImpl.java:1820)
  at android.content.ContextWrapper.unbindService(ContextWrapper.java:548)
  at de.appplant.cordova.plugin.background.BackgroundMode.stopService(BackgroundMode.java:256)
  at de.appplant.cordova.plugin.background.BackgroundMode.onResume(BackgroundMode.java:139)
  at org.apache.cordova.PluginManager.onResume(PluginManager.java:264)
  at org.apache.cordova.CordovaWebViewImpl.handleResume(CordovaWebViewImpl.java:448)
  at org.apache.cordova.CordovaActivity.onResume(CordovaActivity.java:275)
  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)
  at android.app.Activity.performResume(Activity.java:5521)
  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3046)
acosme commented 7 years ago

Hi! same here for my playstore users:

java.lang.RuntimeException: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5146) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5169) at android.app.ActivityThread.access$1700(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1880) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7407) at java.lang.reflect.Method.invoke(Native Method:0) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.IllegalArgumentException: at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1160) at android.app.ContextImpl.unbindService(ContextImpl.java:1475) at android.content.ContextWrapper.unbindService(ContextWrapper.java:644) at de.appplant.cordova.plugin.background.BackgroundMode.stopService(BackgroundMode.java:256) at de.appplant.cordova.plugin.background.BackgroundMode.onDestroy(BackgroundMode.java:148) at org.apache.cordova.PluginManager.onDestroy(PluginManager.java:297) at org.apache.cordova.CordovaWebViewImpl.handleDestroy(CordovaWebViewImpl.java:480) at org.apache.cordova.CordovaActivity.onDestroy(CordovaActivity.java:315) at android.app.Activity.performDestroy(Activity.java:7130) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1171) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5124)

ferdelcorro commented 7 years ago

Same error here!

Hoy, 13:18 en la versión 10107 de la app Motorola Moto G(4) (athene), 2048MB RAM, Android 7.0

java.lang.RuntimeException: at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3421) at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3461) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1523) at android.os.Handler.dispatchMessage (Handler.java:102) 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:867) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:757) Caused by: java.lang.IllegalArgumentException: at android.app.LoadedApk.forgetServiceDispatcher (LoadedApk.java:1289) at android.app.ContextImpl.unbindService (ContextImpl.java:1511) at android.content.ContextWrapper.unbindService (ContextWrapper.java:648) at de.appplant.cordova.plugin.background.BackgroundMode.stopService (BackgroundMode.java:256) at de.appplant.cordova.plugin.background.BackgroundMode.onResume (BackgroundMode.java:139) at org.apache.cordova.PluginManager.onResume (PluginManager.java:265) at org.apache.cordova.CordovaWebViewImpl.handleResume (CordovaWebViewImpl.java:449) at org.apache.cordova.CordovaActivity.onResume (CordovaActivity.java:265) at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1291) at android.app.Activity.performResume (Activity.java:6776) at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3398)

paredesivan commented 6 years ago

me too

Motorola DROID MAXX 2 (lux), 2048MB RAM, Android 6.0 LGE LG Optimus G (geehrc), 2048MB RAM, Android 4.4

java.lang.RuntimeException: at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3121) at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3152) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1398) at android.os.Handler.dispatchMessage (Handler.java:102) at android.os.Looper.loop (Looper.java:148) at android.app.ActivityThread.main (ActivityThread.java:5443) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:618) Caused by: java.lang.IllegalArgumentException: at android.app.LoadedApk.forgetServiceDispatcher (LoadedApk.java:1044) at android.app.ContextImpl.unbindService (ContextImpl.java:1337) at android.content.ContextWrapper.unbindService (ContextWrapper.java:616) at de.appplant.cordova.plugin.background.BackgroundMode.stopService (BackgroundMode.java:256) at de.appplant.cordova.plugin.background.BackgroundMode.onResume (BackgroundMode.java:139) at org.apache.cordova.PluginManager.onResume (PluginManager.java:264) at org.apache.cordova.CordovaWebViewImpl.handleResume (CordovaWebViewImpl.java:448) at org.apache.cordova.CordovaActivity.onResume (CordovaActivity.java:275) at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1281) at android.app.Activity.performResume (Activity.java:6335) at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3110)