Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
949 stars 240 forks source link

Black camera on first open #146

Closed Zazo032 closed 1 year ago

Zazo032 commented 1 year ago

Steps to Reproduce

I could only reproduce this on release mode, not profile or debug. On a Samsung Galaxy A21s, the first time I open the camera (with the CameraAwesome widget), there's a black screen with the following error message:

I/flutter (15729): Camerawesome start after resume state failed: PlatformException(CAMERA_MUST_BE_INIT, init must be call before start, , null)

If I close the route and open it again, the initialization error no longer happens, seems to be only the first time that it's opened.

Expected results

Camera initializes and viewfinder is displayed

Actual results

There was an error initializing the camera

About your device

Brand Model OS
Samsung Galaxy A21s Android 12, OneUI 4.1

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.3, on Microsoft Windows [Versi¢n 10.0.22621.521], locale es-ES)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
Zazo032 commented 1 year ago

https://github.com/Apparence-io/camera_awesome/blob/4539779d41466bd605f7dc682c018cd7314c77f4/lib/camerapreview.dart#L180

g-apparence commented 1 year ago

This should be fixed with the reworked version #150