Skip to content
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

Unhandled Exception: A CameraController was used after being disposed. #1261

Closed
PrabeshPP opened this issue Mar 19, 2022 · 3 comments
Closed
Labels
🐛 bug Something isn't working fixed ? This bug might already be fixed. If so, close it. 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…

Comments

@PrabeshPP
Copy link
Contributor

PrabeshPP commented Mar 19, 2022

What

Unhandled Exception: A CameraController was used after being disposed.

Steps to reproduce the behavior

  1. After the app opens ,click on the profile icon on the bottom bar.
  2. And then click on the History Icon.
    3.After that Click on the Search Icon again.
  3. See error

Note: This error does not always show up.
I got his this error two times,but after restarting the app I did the same but was not able to re-produce.

Why

  • I guess this error should be solved , since a user can face the same error after moving between the pages back and forth.

Screenshot/Mockup/Before-After

Don't have screenshot,but here is the log for that error.

E/flutter (29950): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: A CameraController was used after being disposed.
E/flutter (29950): Once you have called dispose() on a CameraController, it can no longer be used.
E/flutter (29950): #0      ChangeNotifier._debugAssertNotDisposed.<anonymous closure>
package:flutter/…/foundation/change_notifier.dart:114
E/flutter (29950): #1      ChangeNotifier._debugAssertNotDisposed
package:flutter/…/foundation/change_notifier.dart:120
E/flutter (29950): #2      ChangeNotifier.notifyListeners
package:flutter/…/foundation/change_notifier.dart:288
E/flutter (29950): #3      ValueNotifier.value=
package:flutter/…/foundation/change_notifier.dart:412
E/flutter (29950): #4      CameraController.startImageStream
package:camera/src/camera_controller.dart:442
E/flutter (29950): <asynchronous suspension>
E/flutter (29950):

Smartphone model

  • Device: OnePlus 7
  • OS:Android 11

Part of

@teolemon teolemon added 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion… 🐛 bug Something isn't working labels Mar 19, 2022
@teolemon
Copy link
Member

teolemon commented Jul 9, 2022

@PrabeshPP @g123k This one is probably solved

@teolemon teolemon added the fixed ? This bug might already be fixed. If so, close it. label Jul 9, 2022
@g123k
Copy link
Collaborator

g123k commented Jul 9, 2022

+1 I think so

@M123-dev M123-dev closed this as completed Jul 9, 2022
Repository owner moved this from To reproduce to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Jul 9, 2022
@alxlion
Copy link

alxlion commented Dec 29, 2022

I fixed the issue by disposing the camera controller in didUpdateWidget instead of deactivate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working fixed ? This bug might already be fixed. If so, close it. 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…
Development

No branches or pull requests

5 participants