My app crashes after a while (After running OK for more than 12h) with stacktrace as mentioned below:
android.app.RemoteServiceException: can't deliver broadcast
android.app.ActivityThread$H.handleMessage ActivityThread.java:1881
android.os.Handler.dispatchMessage Handler.java:105
android.os.Looper.loop Looper.java:164
android.app.ActivityThread.main ActivityThread.java:6938
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.Zygote$MethodAndArgsCaller.run Zygote.java:327
The app does not have an app specific Broadcasts but registers for Location, Bluetooth and Network related system broadcasts. The broadcasts are registered in onResume of Activity and unregistered in onPause. As mentioned the crash occurs only after app has been running for more than 10 hours. Also so far the issue has occurred only on Samsung Galaxy S8 phones.
I've checked and followed all the fixes mentioned in below stackoverflow thread: Fatal Exception: android.app.RemoteServiceException: can't deliver broadcast at android.os.Handler.dispatchMessage
Please let me know if someone has had this issue or any pointers towards how this can be fixed!
/Amit