Closed Shakle closed 2 months ago
You can do the trick by reloading camera with this code,
errorBuilder: (context, error, child) { controller.stop(); controller.start(); return ScannerReloadingWidget(error: error); }
its not recommended, but its working in my case
Add controller.stop();
in initState
works for me.
void initState() {
// To fix on start error
controller.stop();
super.initState();
}
In my case I did
void initState() { cameraController.stop(); super.initState(); }
It also reproduces when hitting Hot Restart on the screen with MobileScanner and navigating back to it
@juliansteenbakker MobileScannerException: code genericError, message: Called start() while already started.
mobile_scanner: ^3.2.0
on flutter: 3.7.12
.
same issue
Any progress @juliansteenbakker ?
same
We are seeing the same issue on iOS. Adding controller.stop() to initState does not resolve the issue.
We are seeing the same issue on iOS. Adding controller.stop() to initState does not resolve the issue.
Have you tried this?
https://github.com/juliansteenbakker/mobile_scanner/issues/589#issuecomment-1599677867
While I definitelly think instantiating a new controller everytime isn't the prettiest I ended up using the same workaround as the user who wrote the comment.
Works fine for me. Maybe this can help?
I am still hoping this is getting fixed anytime soon though.
This should no longer occur with the new beta, version 5.0.0-beta.1 , as the lifecycle is now no longer managed by mobile_scanner
itself, due to issues with widget tree reparenting.
This should no longer occur with the new beta, version 5.0.0-beta.1 , as the lifecycle is now no longer managed by
mobile_scanner
itself, due to issues with widget tree reparenting.
I've been fighting with this issue for the last two hours in the version 5.0.0-beta.2. If I make a hot restart, I get "MobileScannerException: code genericError, message: Called start() while already started!" The only way I have to make it work is completely closing the App and reopening it.
I am aware that we should handle hot reload better, we have a tracking issue for that specifically: https://github.com/juliansteenbakker/mobile_scanner/issues/773
I still need to figure out if we can intercept it internally, or provide users with guidance around the use of reassemble()
.
After some update recently - wether it was Android 13 QPR 2 (March Pixel update) or Flutter 3.7.7 on first camera initialization I get this error. In Example app it also happens. Did not check on other devices. I also guess that something related to it causes a crash from time to time when disabling/enabling camera.
âšī¸ Environment:
â Steps to reproduce:
đĄ Actual result:
đ Expected result: