plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

lateinit property sensorEventListener has not been initialized

Open Wackymax opened this issue 2 years ago • 12 comments

System info

Platform the Issue occurs on: Android Plugin name: sensors_plus Plugin version: 1.3.1

Steps to Reproduce

  1. Not sure, only seeing the logs in Crashlytics
Caused by x8.r: lateinit property sensorEventListener has not been initialized
       at dev.fluttercommunity.plus.sensors.StreamHandlerImpl.onCancel(StreamHandlerImpl.java:12)
       at dev.fluttercommunity.plus.sensors.SensorsPlugin.teardownEventChannels(SensorsPlugin.java:40)
       at dev.fluttercommunity.plus.sensors.SensorsPlugin.onDetachedFromEngine(SensorsPlugin.java:5)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:143)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:16)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll(FlutterEngineConnectionRegistry.java:11)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy(FlutterEngineConnectionRegistry.java:10)
       at io.flutter.embedding.engine.FlutterEngine.destroy(FlutterEngine.java:31)
       at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:90)
       at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:18)
       at android.app.Activity.performDestroy(Activity.java:8225)
       at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1342)
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5441)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5493)
       at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Wackymax avatar Apr 18 '22 05:04 Wackymax

System info

Platform the Issue occurs on: Android Plugin name: sensors_plus Plugin version: 1.3.1

Steps to Reproduce

  1. Not sure, only seeing the logs in Crashlytics
Caused by x8.r: lateinit property sensorEventListener has not been initialized
       at dev.fluttercommunity.plus.sensors.StreamHandlerImpl.onCancel(StreamHandlerImpl.java:12)
       at dev.fluttercommunity.plus.sensors.SensorsPlugin.teardownEventChannels(SensorsPlugin.java:40)
       at dev.fluttercommunity.plus.sensors.SensorsPlugin.onDetachedFromEngine(SensorsPlugin.java:5)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:143)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:16)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll(FlutterEngineConnectionRegistry.java:11)
       at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy(FlutterEngineConnectionRegistry.java:10)
       at io.flutter.embedding.engine.FlutterEngine.destroy(FlutterEngine.java:31)
       at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:90)
       at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:18)
       at android.app.Activity.performDestroy(Activity.java:8225)
       at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1342)
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5441)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5493)
       at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

same error on Samsung devices

darwin-morocho avatar Apr 18 '22 13:04 darwin-morocho

Do you have any 'Steps to Reproduce' @darwin-morocho ? I can test with a samsung s8, would that device be representative of the issue?

fabiancrx avatar Apr 19 '22 00:04 fabiancrx

Open a flutter app but don't open any of the sensor streams. Press the back button to close the app.

On 19 Apr 2022, at 02:08, fabiancrx @.***> wrote:

 Do you have any 'Steps to Reproduce' @darwin-morocho ? I can test with a samsung s8, would that device be representative of the issue?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

Wackymax avatar Apr 19 '22 04:04 Wackymax

Do you have any 'Steps to Reproduce' @darwin-morocho ? I can test with a samsung s8, would that device be representative of the issue?

Galaxy S21+ 5G and Galaxy S8+. I my case I just close the app and then In my firebase console I have the next error report

dev.fluttercommunity.plus.sensors.StreamHandlerImpl.onCancel (StreamHandlerImpl.java:12)
dev.fluttercommunity.plus.sensors.SensorsPlugin.teardownEventChannels (SensorsPlugin.java:40)
dev.fluttercommunity.plus.sensors.SensorsPlugin.onDetachedFromEngine (SensorsPlugin.java:5)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove (FlutterEngineConnectionRegistry.java:143)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove (FlutterEngineConnectionRegistry.java:16)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll (FlutterEngineConnectionRegistry.java:11)
io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy (FlutterEngineConnectionRegistry.java:10)
io.flutter.embedding.engine.FlutterEngine.destroy (FlutterEngine.java:31)
io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach (FlutterActivityAndFragmentDelegate.java:90)
io.flutter.embedding.android.FlutterActivity.onDestroy (FlutterActivity.java:18)
android.app.Activity.performDestroy (Activity.java:8468)
android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1344)
android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5622)
android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5682)
android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:44)
android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2317)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loop (Looper.java:246)
android.app.ActivityThread.main (ActivityThread.java:8595)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)

darwin-morocho avatar Apr 19 '22 15:04 darwin-morocho

Thanks @darwin-morocho and @Wackymax, I'll take a look at this issue

fabiancrx avatar Apr 19 '22 16:04 fabiancrx

Actually it seems this issue should be solved after #838 is merged

fabiancrx avatar Apr 19 '22 17:04 fabiancrx

Actually it seems this issue should be solved after #838 is merged

It happens to most of the devices and the emulator as well using sensors_plus: 1.3.1 . Just when you close the app with the back button it occurs.

iskamal avatar Apr 19 '22 18:04 iskamal

Any update on this? I see there is an open PR, when will it be merged and released?

Wackymax avatar May 03 '22 05:05 Wackymax

My app also has this issue, so it would be great if the PR was merged as soon as possible.

Medformatik avatar May 20 '22 05:05 Medformatik

Please fix this bug

offline-first avatar May 28 '22 20:05 offline-first

For anyone who is in a hurry or blocked by this PR not being merged you could just override the dependency with the code from the PR in your pubspec.yaml

dependencies:
  sensors_plus:
    git:
      url: https://github.com/Rexios80/plus_plugins
      ref: c6ddf49f6c2a3ea553c86033ef5427893dc07707
      path: packages/sensors_plus/sensors_plus

cc: @offline-first

fabiancrx avatar May 28 '22 21:05 fabiancrx

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Aug 30 '22 00:08 github-actions[bot]

We can close this as #838 is merged👀

SirusCodes avatar Oct 23 '22 14:10 SirusCodes