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
957 stars 245 forks source link

Camera does not open on old Android 5 (sdk 21) - PlatformException #367

Closed ynnob closed 10 months ago

ynnob commented 1 year ago

Steps to Reproduce

Open the camera on an old android device. The view will not get initialized because an platform exception is thrown and therefore the StreamSubscription<MediaCapture?> is never subscribed.

Exception captured by Firebase Crashlytics:

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: PlatformException(channel-error, Unable to establish connection on channel., null, null)
       at CameraInterface.setupCamera(pigeon.dart:567)
       at PreparingCameraState._init(preparing_camera_state.dart:190)
       at PreparingCameraState._startPhotoMode(preparing_camera_state.dart:144)
       at PreparingCameraState.start(preparing_camera_state.dart:34)

About your device

Company: Asus Model: The New PadFone Infinity (A86) Orientation: Portrait FreeRAM: 584.69 MB Free Storage: 3.3 GB

OS: Version: Android 5.0.2 Orientation: Portrait Rooting: No

Your flutter version

[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.19045.3086], locale de-DE)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web                                                
[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.1.1)  
[√] Android Studio (version 2022.2)                                             
[√] VS Code (version 1.78.2)                                                    
[√] Connected device (4 available)
[√] Network resources

CamerAwesome Version

Version: 1.4.0

g-apparence commented 1 year ago

This start to be a very old version. we should check the minimum version required by cameraX now and upgrade our minimum android version too. As we rely on cameraX please refer to this minimum version.

ynnob commented 1 year ago

This start to be a very old version. we should check the minimum version required by cameraX now and upgrade our minimum android version too. As we rely on cameraX please refer to this minimum version.

According to cameraX they support sdk 21+ (link)

Make sure you have a miniSdkVersion with 21 or higher in your android/app/build.gradle file, because the camera2 API which
CameraX used only support Android 5.0 or above.

Should i open an issue with them instead?

g-apparence commented 10 months ago

CameraX is not working on 21 sdk. We have upgraded the version. This should now work correctly.