loup-v / beacons

Flutter beacons plugin for Android and iOS.
Apache License 2.0
78 stars 54 forks source link

java.lang.IllegalArgumentException: Service not registered #20

Open indiluk opened 5 years ago

indiluk commented 5 years ago

When using the flutter plugin _barcodescan our Android app crashes when closing the barcode scanner activity.

E/AndroidRuntime(12011): java.lang.RuntimeException: Unable to destroy activity {at.pluscity.PlusCity/com.apptreesoftware.barcodescan.BarcodeScannerActivity}: java.lang.IllegalArgumentException: Service not registered: org.altbeacon.beacon.BeaconManager$BeaconServiceConnection@2036956e E/AndroidRuntime(12011): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4891) E/AndroidRuntime(12011): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4909) E/AndroidRuntime(12011): at android.app.ActivityThread.access$1600(ActivityThread.java:218) E/AndroidRuntime(12011): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1788) E/AndroidRuntime(12011): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(12011): at android.os.Looper.loop(Looper.java:145) E/AndroidRuntime(12011): at android.app.ActivityThread.main(ActivityThread.java:6934) E/AndroidRuntime(12011): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(12011): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(12011): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) E/AndroidRuntime(12011): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) E/AndroidRuntime(12011): Caused by: java.lang.IllegalArgumentException: Service not registered: org.altbeacon.beacon.BeaconManager$BeaconServiceConnection@2036956e E/AndroidRuntime(12011): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1141) E/AndroidRuntime(12011): at android.app.ContextImpl.unbindService(ContextImpl.java:2254) E/AndroidRuntime(12011): at android.content.ContextWrapper.unbindService(ContextWrapper.java:572) E/AndroidRuntime(12011): at io.intheloup.beacons.logic.BeaconsClient.unbindService(BeaconsClient.kt:246) E/AndroidRuntime(12011): at org.altbeacon.beacon.BeaconManager.unbind(BeaconManager.java:453) E/AndroidRuntime(12011): at io.intheloup.beacons.logic.BeaconsClient.unbind(BeaconsClient.kt:61) E/AndroidRuntime(12011): at io.intheloup.beacons.BeaconsPlugin$1.onActivityDestroyed(BeaconsPlugin.kt:35) E/AndroidRuntime(12011): at android.app.Application.dispatchActivityDestroyed(Application.java:269) E/AndroidRuntime(12011): at android.app.Activity.onDestroy(Activity.java:1861) E/AndroidRuntime(12011): at android.app.Activity.performDestroy(Activity.java:6843) E/AndroidRuntime(12011): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1169) E/AndroidRuntime(12011): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4869) E/AndroidRuntime(12011): ... 10 more

indiluk commented 5 years ago

This bug report is kind of related to the described issue https://github.com/AltBeacon/android-beacon-library/issues/139

vinceramcesoliveros commented 5 years ago

please refer to other issues that have been discussed especially on google_sign_in. check the PR->files changed to modify the code or use someone else's forked beacon. I don't know if the author wants to continue this project.