Wayaer / fl_mlkit

Google mlkit scanning plugin, supports Android and IOS.
MIT License
16 stars 2 forks source link

Crash when used with workmanager #20

Closed shingohu closed 8 months ago

shingohu commented 8 months ago
FATAL EXCEPTION: main
                                                                                                    Process: com.lianke.uutalk, PID: 24435
                                                                                                    kotlin.UninitializedPropertyAccessException: lateinit property channel has not been initialized
                                                                                                        at fl.camera.FlCameraPlugin.onDetachedFromEngine(FlCameraPlugin.kt:35)
                                                                                                        at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:272)
                                                                                                        at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:280)
                                                                                                        at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll(FlutterEngineConnectionRegistry.java:288)
                                                                                                        at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy(FlutterEngineConnectionRegistry.java:123)
                                                                                                        at io.flutter.embedding.engine.FlutterEngine.destroy(FlutterEngine.java:467)
                                                                                                        at dev.fluttercommunity.workmanager.BackgroundWorker.stopEngine$lambda-3(BackgroundWorker.kt:143)
                                                                                                        at dev.fluttercommunity.workmanager.BackgroundWorker.$r8$lambda$FYL5fT_Q2tlFLHZfrfSEjKC1700(Unknown Source:0)
                                                                                                        at dev.fluttercommunity.workmanager.BackgroundWorker$$ExternalSyntheticLambda2.run(Unknown Source:2)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:230)
                                                                                                        at android.os.Looper.loop(Looper.java:319)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8893)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Wayaer commented 8 months ago

You can update to version 4.1.0 and test again