In my flutter app, I am suddenly not able to take a photo on any Android 10 devices. I could easily do it on Android 14 and any iPhone. I am not sure what is causing the issue. I get some error I didn’t use to see:
E/ObserverFlutterApi(25579): The Observer that received a callback has been garbage collected. Please create a new instance to receive any further data changes.
E/ObserverFlutterApi(25579): The Observer that received a callback has been garbage collected. Please create a new instance to receive any further data changes.
E/CameraCaptureSession(25579): Session 0: Exception while stopping repeating:
E/CameraCaptureSession(25579): android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error
This is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app" xmlns:tools="http://schemas.android.com/tools">
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
I also tried without <uses-permission android:name="android.permission.CAMERA"/>
and without
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
Code sample – https://pastebin.com/pCQWzwSx
console logs – https://pastebin.com/idWeKqVK
What I tried:
image_picker package – works just fine