Open sergey-triputsco opened 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have the error too。 location version:4.3.0 E/AndroidRuntime(20904): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.flutter.plugin.common.PluginRegistry$RequestPermissionsResultListener com.lyokone.location.FlutterLocationService.getServiceRequestPermissionsResultListener()' on a null object reference E/AndroidRuntime(20904): at com.lyokone.location.LocationPlugin.dispose(LocationPlugin.java:117) E/AndroidRuntime(20904): at com.lyokone.location.LocationPlugin.detachActivity(LocationPlugin.java:56) E/AndroidRuntime(20904): at com.lyokone.location.LocationPlugin.onDetachedFromActivityForConfigChanges(LocationPlugin.java:74) E/AndroidRuntime(20904): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.detachFromActivityForConfigChanges(FlutterEngineConnectionRegistry.java:375) E/AndroidRuntime(20904): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:630) E/AndroidRuntime(20904): at io.flutter.embedding.android.FlutterActivity.release(FlutterActivity.java:622) E/AndroidRuntime(20904): at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:643) E/AndroidRuntime(20904): at android.app.Activity.performDestroy(Activity.java:8319) E/AndroidRuntime(20904): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1376) E/AndroidRuntime(20904): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5441) E/AndroidRuntime(20904): ... 15 more
same issue on version 4.3.0
I arrived here since I just saw this issue in version 5.0.3. The app was closed and it went through all of the lifecycle changes and this happened when the lifecycle changed to detached.
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'io.flutter.plugin.common.PluginRegistry$RequestPermissionsResultListener com.lyokone.location.FlutterLocationService.h()' on a null object reference at com.lyokone.location.LocationPlugin.dispose(LocationPlugin.java:20) at com.lyokone.location.LocationPlugin.detachActivity(LocationPlugin.java) at com.lyokone.location.LocationPlugin.onDetachedFromActivityForConfigChanges(LocationPlugin.java) at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.detachFromActivityForConfigChanges(:37) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(:53) at io.flutter.embedding.android.FlutterActivity.onDestroy(:18) at android.app.Activity.performDestroy(Activity.java:8748) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1421) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5521) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5570) at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5874) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5789) at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71) at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2399) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loopOnce(Looper.java:238) at android.os.Looper.loop(Looper.java:357) at android.app.ActivityThread.main(ActivityThread.java:8094) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:957)
Plugin crashes on handling Android configuration change.
Crash happens on the next OS versions Android 9, 10, 11, 12.