-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stopping the controller crashes the app #5
Comments
Also, I my case the app crashes when just hot reloading with the camera open. |
Fixed with #6 and released in v0.1.0. Thanks for reporting! |
@juliansteenbakker, #6 doesn't solve this issue, and it persists in the new release. It seems to happen due to trying to access a |
Oh my bad, i didn't test it yet but i will later today. |
Same issue here when using stop function in the controller in real Android device
|
When running in the emulator, some kind of nightmare happens, the emulator seems to report control information and immediately reset it, stack overflow detection effect, multiple method call and reset in the emulator |
I did some testing using a Pixel 4a 5G and i can sucessfully stop and start the camera multiple times. There are however errors thrown if u call stop while the camera is already stopped. Also, starting the camera 2 times crashes the app. I am working on some fixes for this and will update this when ready. |
Bug example: I open the scanning page which open the camera, and then try to close the page by Solution: Is it possible to add an option to stop the camera after a duration which we can change the duration manually in the code? |
@juliansteenbakker Thank you very much for your contribution. In 0.1.2, cameracontroller.stop will not stop scanning |
Platform: iOS
Version: ^0.0.3
Crash log when `MobileScanerController.stop()` is called.
Runner was compiled with optimization - stepping may behave oddly; variables may not be available.
thread # 1, queue = 'com.apple.main-thread', stop reason = Swift runtime failure: Unexpectedly found nil while implicitly unwrapping an Optional value
frame # 1: 0x00000001056cea70 Runner specialized SwiftMobileScannerPlugin.stop(self=0x000000028252de00) at SwiftMobileScannerPlugin.swift:239:9 [opt]
236 }
237
238 func stop(_ result: FlutterResult) {
-> 239 captureSession.stopRunning()
^
240 for input in captureSession.inputs {
241 captureSession.removeInput(input)
242 }
Target 0: (Runner) stopped.
I have tried to add a null check on the
captureSession
and other variables that are causing the crash and it fixes the crash, but then it won't stop scanning.Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):The text was updated successfully, but these errors were encountered: