-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ionic + cordova-plugin-background-mode Unable to resume activity / Service not registered #204
Comments
@ishanthilina What plugin version do you use? Did you try out the latest master branch? |
@katzer We are receiving crash reports with the same error message, using the latest version of the plugin. (OS Version: 6.0.1)
|
I can't reproduce the case from @ishanthilina. But the Firebase Crashlytics are presenting a considerable number of cases with this error, using the latest master branch. The error occur on multiple android versions, but more than 50% with Android 8.
@katzer can you provide some help on this, something that we can use to try solve that error. |
Having the same problem android 8.0 and 9.0 did you have any sucess @lkonzen-garupa ? |
How was this fixed? |
Same issue on a couple of Android 9 devices. It does not happen always, it is random. Like once in three times... |
@lkonzen-garupa, @Tioecomp did you solve the issue? |
@mirko77 yes, it was solved by stop using this plugin. https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background |
@lkonzen-garupa thank you, I will give it a try. |
@lkonzen-garupa same issue with that plugin. |
Following is the code I use to enable the background mode in my ionic app.
When I lock the screen when the app has focus (app is running in foreground) and try to unlock the screen again, I get the following exception.
11-10 00:43:42.426 5464-5464/com.ionicframework.mishuttle855256 E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ionicframework.mishuttle855256, PID: 5464 java.lang.RuntimeException: Unable to resume activity {com.ionicframework.mishuttle855256/com.ionicframework.mishuttle855256.MainActivity}: java.lang.IllegalArgumentException: Service not registered: de.appplant.cordova.plugin.background.BackgroundMode$1@7302666 at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3273) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3304) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1513) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5697) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749) Caused by: java.lang.IllegalArgumentException: Service not registered: de.appplant.cordova.plugin.background.BackgroundMode$1@7302666 at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1085) at android.app.ContextImpl.unbindService(ContextImpl.java:1439) at android.content.ContextWrapper.unbindService(ContextWrapper.java:616) at de.appplant.cordova.plugin.background.BackgroundMode.stopService(BackgroundMode.java:250) at de.appplant.cordova.plugin.background.BackgroundMode.onResume(BackgroundMode.java:145) at org.apache.cordova.PluginManager.onResume(PluginManager.java:265) at org.apache.cordova.CordovaWebViewImpl.handleResume(CordovaWebViewImpl.java:448) at org.apache.cordova.CordovaActivity.onResume(CordovaActivity.java:265) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1268) at android.app.Activity.performResume(Activity.java:6345) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3258) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3304) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1513) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5697) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)
But if I switch to another app and then lock screen, this does not happen.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: