Skip to content

[camera] Android emulator camera throws CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error when taking a photo #92762

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

Open
proninyaroslav opened this issue Oct 30, 2021 · 38 comments
Labels
c: crash Stack traces logged to the console e: OS-version specific Affects only some versions of the relevant operating system found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@proninyaroslav
Copy link

This issue is reproduced in the plugin example, only in Android 12 emulator with the latest plugin version.
https://github.com/flutter/plugins/blob/master/packages/camera/camera/example/lib/main.dart

Steps to Reproduce

  1. Run the example, give all permission
  2. Select the main camera, click the capture button

Expected results:
Taking a photo must be successful

Actual results:
Camera crash occurred:

[  +73 ms] I/Camera  ( 7120): open | onError
[        ] I/Camera  ( 7120): close
[        ] I/Camera  ( 7120): closeCaptureSession
[  +11 ms] E/CameraCaptureSession( 7120): Session 0: Exception while
stopping repeating: 
[        ] E/CameraCaptureSession( 7120):
android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The
camera device has encountered a serious error
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInEr
ror(CameraDeviceImpl.java:2340)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDevic
eImpl.java:1267)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptu
reSessionImpl.java:579)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1085)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera.close(Camera.java:1092)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera$1.onError(Camera.java:291)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.notifyError(CameraDeviceI
mpl.java:1738)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.$r8$lambda$KBQCqQRdhVVn7u
HI9Xdha6OqnsU(Unknown Source:0)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl$$ExternalSyntheticLambda0
.accept(Unknown Source:8)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(Pool
edLambdaImpl.java:278)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(Pooled
LambdaImpl.java:201)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.
java:97)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Handler.handleCallback(Handler.java:938)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Handler.dispatchMessage(Handler.java:99)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Looper.loopOnce(Looper.java:201)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Looper.loop(Looper.java:288)
[        ] E/CameraCaptureSession( 7120):       at
android.os.HandlerThread.run(HandlerThread.java:67)
Logs
[  +74 ms] executing: uname -m
[  +35 ms] Exit code 0 from: uname -m
[        ] x86_64
[   +5 ms] executing: [/home/user/dev/flutter/] git -c
log.showSignature=false log -n 1 --pretty=format:%H
[  +12 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%H
[   +1 ms] 18116933e77adc82f80866c928266a5b4f1ed645
[   +1 ms] executing: [/home/user/dev/flutter/] git tag --points-at
18116933e77adc82f80866c928266a5b4f1ed645
[  +29 ms] Exit code 0 from: git tag --points-at
18116933e77adc82f80866c928266a5b4f1ed645
[        ] 2.5.3
[   +9 ms] executing: [/home/user/dev/flutter/] git rev-parse
--abbrev-ref --symbolic @{u}
[   +5 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/home/user/dev/flutter/] git ls-remote
--get-url origin
[   +6 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +98 ms] executing: [/home/user/dev/flutter/] git rev-parse
--abbrev-ref HEAD
[   +8 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +61 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required,
skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not
required, skipping update.
[  +65 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
devices -l
[  +47 ms] List of devices attached
           emulator-5554          device product:sdk_gphone64_x86_64
           model:sdk_gphone64_x86_64 device:emulator64_x86_64_arm64
           transport_id:1
[   +9 ms] /home/user/dev/Android/sdk/platform-tools/adb -s
emulator-5554 shell getprop
[  +42 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required,
skipping update.
[   +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required,
skipping update.
[   +5 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not
required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not
required, skipping update.
[ +120 ms] Skipping pub get: version match.
[  +23 ms] Found plugin camera_web at
/home/user/.pub-cache/hosted/pub.dartlang.org/camera_web-0.2.1+1/
[  +17 ms] Found plugin flutter_plugin_android_lifecycle at
/home/user/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android
_lifecycle-2.0.4/
[   +7 ms] Found plugin path_provider at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.5/
[   +2 ms] Found plugin path_provider_linux at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.
1.0/
[   +1 ms] Found plugin path_provider_macos at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.
0.2/
[   +4 ms] Found plugin path_provider_windows at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-
2.0.3/
[  +18 ms] Found plugin video_player at
/home/user/.pub-cache/hosted/pub.dartlang.org/video_player-2.2.5/
[   +2 ms] Found plugin video_player_web at
/home/user/.pub-cache/hosted/pub.dartlang.org/video_player_web-2.0.4
/
[   +4 ms] Found plugin camera at
/home/user/data/git/plugins/packages/camera/camera/
[  +16 ms] Found plugin integration_test at
/home/user/dev/flutter/packages/integration_test/
[ +195 ms] Found plugin camera_web at
/home/user/.pub-cache/hosted/pub.dartlang.org/camera_web-0.2.1+1/
[   +7 ms] Found plugin flutter_plugin_android_lifecycle at
/home/user/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android
_lifecycle-2.0.4/
[   +5 ms] Found plugin path_provider at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.5/
[   +2 ms] Found plugin path_provider_linux at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.
1.0/
[   +1 ms] Found plugin path_provider_macos at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.
0.2/
[   +2 ms] Found plugin path_provider_windows at
/home/user/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-
2.0.3/
[   +9 ms] Found plugin video_player at
/home/user/.pub-cache/hosted/pub.dartlang.org/video_player-2.2.5/
[   +1 ms] Found plugin video_player_web at
/home/user/.pub-cache/hosted/pub.dartlang.org/video_player_web-2.0.4
/
[   +3 ms] Found plugin camera at
/home/user/data/git/plugins/packages/camera/camera/
[   +7 ms] Found plugin integration_test at
/home/user/dev/flutter/packages/integration_test/
[  +26 ms] Generating
/home/user/data/git/plugins/packages/camera/camera/example/android/a
pp/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[  +48 ms] ro.hardware = ranchu
[  +17 ms] Using hardware rendering with device sdk gphone64 x86 64. If
you notice
           graphics artifacts, consider enabling software rendering with
           "--enable-software-rendering".
[  +32 ms] Initializing file store
[  +34 ms] Skipping target: gen_localizations
[   +4 ms] Skipping target: gen_dart_plugin_registrant
[        ] Skipping target: _composite
[   +2 ms] complete
[   +5 ms] Launching lib/main.dart on sdk gphone64 x86 64 in debug
mode...
[   +5 ms] /home/user/dev/flutter/bin/cache/dart-sdk/bin/dart
--disable-dart-dev
/home/user/dev/flutter/bin/cache/artifacts/engine/linux-x64/frontend
_server.dart.snapshot --sdk-root
/home/user/dev/flutter/bin/cache/artifacts/engine/common/flutter_pat
ched_sdk/ --incremental --target=flutter --debugger-module-names
--experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true
--output-dill /tmp/flutter_tools.TOYMBW/flutter_tool.OWEFZI/app.dill
--packages
/home/user/data/git/plugins/packages/camera/camera/example/.dart_too
l/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false
--enable-asserts --track-widget-creation --filesystem-scheme
org-dartlang-root --initialize-from-dill
build/c075001b96339384a97db4862b8ab8db.cache.dill.track.dill
--enable-experiment=alternative-invalidation-strategy
[   +7 ms] executing:
/home/user/dev/Android/sdk/build-tools/30.0.3/aapt dump xmltree
/home/user/data/git/plugins/packages/camera/camera/example/build/app
/outputs/flutter-apk/app.apk AndroidManifest.xml
[  +41 ms] Exit code 0 from:
/home/user/dev/Android/sdk/build-tools/30.0.3/aapt dump xmltree
/home/user/data/git/plugins/packages/camera/camera/example/build/app
/outputs/flutter-apk/app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1d
               A: android:compileSdkVersionCodename(0x01010573)="10"
               (Raw: "10")
               A: package="io.flutter.plugins.cameraexample" (Raw:
               "io.flutter.plugins.cameraexample")
               A: platformBuildVersionCode=(type 0x10)0x1d
               A: platformBuildVersionName=(type 0x10)0xa
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x15
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-feature (line=11)
                 A: android:name(0x01010003)="android.hardware.camera"
                 (Raw: "android.hardware.camera")
                 A: android:required(0x0101028e)=(type 0x12)0xffffffff
               E: uses-permission (line=15)
                 A:
                 android:name(0x01010003)="android.permission.INTERNET"
                 (Raw: "android.permission.INTERNET")
               E: uses-permission (line=16)
                 A:
                 android:name(0x01010003)="android.permission.FLASHLIGHT
                 " (Raw: "android.permission.FLASHLIGHT")
               E: uses-permission (line=17)
                 A: android:name(0x01010003)="android.permission.CAMERA"
                 (Raw: "android.permission.CAMERA")
               E: uses-permission (line=18)
                 A:
                 android:name(0x01010003)="android.permission.RECORD_AUD
                 IO" (Raw: "android.permission.RECORD_AUDIO")
               E: uses-permission (line=19)
                 A:
                 android:name(0x01010003)="android.permission.ACCESS_NET
                 WORK_STATE" (Raw:
                 "android.permission.ACCESS_NETWORK_STATE")
               E: application (line=21)
                 A: android:label(0x01010001)="camera_example" (Raw:
                 "camera_example")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A:
                 android:appComponentFactory(0x0101057a)="androidx.core.
                 app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=26)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A:
                   android:name(0x01010003)="io.flutter.embedding.androi
                   d.FlutterActivity" (Raw:
                   "io.flutter.embedding.android.FlutterActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type
                   0x11)0x24b4
                   A: android:windowSoftInputMode(0x0101022b)=(type
                   0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type
                   0x12)0xffffffff
                   E: intent-filter (line=33)
                     E: action (line=34)
                       A:
                       android:name(0x01010003)="android.intent.action.M
                       AIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=36)
                       A:
                       android:name(0x01010003)="android.intent.category
                       .LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=40)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw:
                   "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[  +12 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
-s emulator-5554 shell -x logcat -v time -t 1
[  +10 ms] <- compile package:camera_example/main.dart
[  +47 ms] --------- beginning of main
           10-30 18:25:00.012 D/EGL_emulation(  739): app_time_stats:
           avg=17467.10ms min=17467.10ms max=17467.10ms count=1
[  +16 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
version
[   +9 ms] Android Debug Bridge version 1.0.41
           Version 31.0.3-7562133
           Installed as
           /home/user/dev/Android/sdk/platform-tools/adb
[   +2 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
start-server
[  +74 ms] Building APK
[  +15 ms] Running Gradle task 'assembleDebug'...
[   +3 ms] Using gradle from
/home/user/data/git/plugins/packages/camera/camera/example/android/g
radlew.
[  +23 ms] executing:
/home/user/dev/Android/android-studio/jre/bin/java -version
[ +117 ms] Exit code 0 from:
/home/user/dev/Android/android-studio/jre/bin/java -version
[        ] openjdk version "11.0.10" 2021-01-19
           OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
           OpenJDK 64-Bit Server VM (build 11.0.10+0-b96-7249189, mixed
           mode)
[   +1 ms] executing:
/home/user/dev/Android/android-studio/jre/bin/java -version
[ +107 ms] Exit code 0 from:
/home/user/dev/Android/android-studio/jre/bin/java -version
[        ] openjdk version "11.0.10" 2021-01-19
           OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
           OpenJDK 64-Bit Server VM (build 11.0.10+0-b96-7249189, mixed
           mode)
[   +1 ms] executing:
/home/user/dev/Android/android-studio/jre/bin/java -version
[ +103 ms] Exit code 0 from:
/home/user/dev/Android/android-studio/jre/bin/java -version
[        ] openjdk version "11.0.10" 2021-01-19
           OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
           OpenJDK 64-Bit Server VM (build 11.0.10+0-b96-7249189, mixed
           mode)
[   +2 ms] executing:
[/home/user/data/git/plugins/packages/camera/camera/example/android/
]
/home/user/data/git/plugins/packages/camera/camera/example/android/g
radlew -Pverbose=true -Ptarget-platform=android-x64
-Ptarget=/home/user/data/git/plugins/packages/camera/camera/example/
lib/main.dart -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==
-Pdart-obfuscation=false -Ptrack-widget-creation=true
-Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root
assembleDebug
[+5005 ms] > Task :app:compileFlutterBuildDebug
[        ] [  +70 ms] executing: uname -m
[        ] [  +35 ms] Exit code 0 from: uname -m
[        ] [        ] x86_64
[        ] [   +5 ms] executing: [/home/user/dev/flutter/] git -c
log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] [   +5 ms] Exit code 0 from: git -c log.showSignature=false
log -n 1 --pretty=format:%H
[        ] [        ] 18116933e77adc82f80866c928266a5b4f1ed645
[        ] [        ] executing: [/home/user/dev/flutter/] git tag
--points-at 18116933e77adc82f80866c928266a5b4f1ed645
[        ] [  +24 ms] Exit code 0 from: git tag --points-at
18116933e77adc82f80866c928266a5b4f1ed645
[        ] [        ] 2.5.3
[        ] [   +9 ms] executing: [/home/user/dev/flutter/] git
rev-parse --abbrev-ref --symbolic @{u}
[        ] [   +5 ms] Exit code 0 from: git rev-parse --abbrev-ref
--symbolic @{u}
[        ] [        ] origin/stable
[        ] [        ] executing: [/home/user/dev/flutter/] git
ls-remote --get-url origin
[        ] [   +7 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] [        ] https://github.com/flutter/flutter.git
[        ] [  +62 ms] executing: [/home/user/dev/flutter/] git
rev-parse --abbrev-ref HEAD
[        ] [   +7 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] [        ] stable
[        ] [  +51 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts'
is not required, skipping update.
[        ] [        ] Artifact Instance of
'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IOSEngineArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not
required, skipping update.
[        ] [   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is
not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'WindowsUwpEngineArtifacts'
is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is
not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is
not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts'
is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols'
is not required, skipping update.
[        ] [  +92 ms] Artifact Instance of 'MaterialFonts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'GradleWrapper' is not
required, skipping update.
[        ] [   +2 ms] Artifact Instance of
'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IOSEngineArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterSdk' is not required,
skipping update.
[        ] [        ] Artifact Instance of 'WindowsEngineArtifacts' is
not required, skipping update.
[        ] [        ] Artifact Instance of 'WindowsUwpEngineArtifacts'
is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is
not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is
not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts'
is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols'
is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'FontSubsetArtifacts' is not
required, skipping update.
[        ] [        ] Artifact Instance of 'PubDependencies' is not
required, skipping update.
[        ] [  +29 ms] Initializing file store
[        ] [  +94 ms] Done initializing file store
[        ] [  +97 ms] Skipping target: gen_localizations
[        ] [  +26 ms] Skipping target: gen_dart_plugin_registrant
[        ] [ +685 ms] Skipping target: kernel_snapshot
[ +116 ms] [ +566 ms] Skipping target: debug_android_application
[        ] [   +1 ms] Persisting file store
[        ] [  +17 ms] Done persisting file store
[ +100 ms] [  +72 ms] build succeeded.
[        ] [  +13 ms] "flutter assemble" took 1 719ms.
[        ] [   +4 ms] Running shutdown hooks
[        ] [        ] Shutdown hooks complete
[        ] [   +3 ms] exiting with code 0
[  +97 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[        ] > Task :app:preBuild UP-TO-DATE
[        ] > Task :app:preDebugBuild UP-TO-DATE
[        ] > Task :camera:preBuild UP-TO-DATE
[        ] > Task :camera:preDebugBuild UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:preBuild UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:preDebugBuild
UP-TO-DATE
[        ] > Task :integration_test:preBuild UP-TO-DATE
[        ] > Task :integration_test:preDebugBuild UP-TO-DATE
[        ] > Task :path_provider:preBuild UP-TO-DATE
[  +96 ms] > Task :path_provider:preDebugBuild UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:compileDebugAidl
NO-SOURCE
[        ] > Task :camera:compileDebugAidl NO-SOURCE
[        ] > Task :integration_test:compileDebugAidl NO-SOURCE
[        ] > Task :path_provider:compileDebugAidl NO-SOURCE
[        ] > Task :video_player:preBuild UP-TO-DATE
[        ] > Task :video_player:preDebugBuild UP-TO-DATE
[        ] > Task :camera:packageDebugRenderscript NO-SOURCE
[        ] > Task
:flutter_plugin_android_lifecycle:packageDebugRenderscript NO-SOURCE
[        ] > Task :integration_test:packageDebugRenderscript NO-SOURCE
[        ] > Task :video_player:compileDebugAidl NO-SOURCE
[        ] > Task :app:compileDebugAidl NO-SOURCE
[        ] > Task :path_provider:packageDebugRenderscript NO-SOURCE
[        ] > Task :video_player:packageDebugRenderscript NO-SOURCE
[        ] > Task :app:compileDebugRenderscript NO-SOURCE
[        ] > Task :app:checkDebugManifest UP-TO-DATE
[        ] > Task :app:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :camera:compileDebugRenderscript NO-SOURCE
[        ] > Task :camera:checkDebugManifest UP-TO-DATE
[        ] > Task :camera:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :camera:generateDebugResValues UP-TO-DATE
[        ] > Task :camera:generateDebugResources UP-TO-DATE
[        ] > Task :camera:packageDebugResources UP-TO-DATE
[        ] > Task :camera:parseDebugLibraryResources UP-TO-DATE
[        ] > Task :camera:processDebugManifest UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:generateDebugResValues UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:compileDebugRenderscript NO-SOURCE
[        ] > Task
:flutter_plugin_android_lifecycle:generateDebugResources UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:packageDebugResources UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:parseDebugLibraryResources UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:checkDebugManifest
UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:processDebugManifest
UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:generateDebugRFile
UP-TO-DATE
[        ] > Task :camera:generateDebugRFile UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:javaPreCompileDebug
UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:bundleLibCompileDebug UP-TO-DATE
[        ] > Task :camera:javaPreCompileDebug UP-TO-DATE
[        ] > Task :camera:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :camera:bundleLibCompileDebug UP-TO-DATE
[        ] > Task :integration_test:checkDebugManifest UP-TO-DATE
[        ] > Task :integration_test:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :integration_test:compileDebugRenderscript NO-SOURCE
[        ] > Task :integration_test:generateDebugResValues UP-TO-DATE
[        ] > Task :integration_test:generateDebugResources UP-TO-DATE
[   +1 ms] > Task :integration_test:packageDebugResources UP-TO-DATE
[  +78 ms] > Task :integration_test:parseDebugLibraryResources
UP-TO-DATE
[        ] > Task :integration_test:processDebugManifest UP-TO-DATE
[        ] > Task :integration_test:generateDebugRFile UP-TO-DATE
[        ] > Task :integration_test:javaPreCompileDebug UP-TO-DATE
[        ] > Task :integration_test:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :integration_test:bundleLibCompileDebug UP-TO-DATE
[        ] > Task :path_provider:compileDebugRenderscript NO-SOURCE
[        ] > Task :path_provider:checkDebugManifest UP-TO-DATE
[        ] > Task :path_provider:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :path_provider:generateDebugResValues UP-TO-DATE
[        ] > Task :path_provider:generateDebugResources UP-TO-DATE
[        ] > Task :path_provider:packageDebugResources UP-TO-DATE
[        ] > Task :path_provider:parseDebugLibraryResources UP-TO-DATE
[        ] > Task :path_provider:processDebugManifest UP-TO-DATE
[        ] > Task :path_provider:generateDebugRFile UP-TO-DATE
[        ] > Task :path_provider:javaPreCompileDebug UP-TO-DATE
[        ] > Task :path_provider:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :path_provider:bundleLibCompileDebug UP-TO-DATE
[        ] > Task :video_player:checkDebugManifest UP-TO-DATE
[        ] > Task :video_player:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :video_player:compileDebugRenderscript NO-SOURCE
[        ] > Task :video_player:generateDebugResValues UP-TO-DATE
[        ] > Task :video_player:generateDebugResources UP-TO-DATE
[        ] > Task :video_player:packageDebugResources UP-TO-DATE
[        ] > Task :video_player:parseDebugLibraryResources UP-TO-DATE
[        ] > Task :video_player:processDebugManifest UP-TO-DATE
[        ] > Task :video_player:generateDebugRFile UP-TO-DATE
[        ] > Task :video_player:javaPreCompileDebug UP-TO-DATE
[        ] > Task :video_player:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :video_player:bundleLibCompileDebug UP-TO-DATE
[        ] > Task :app:javaPreCompileDebug UP-TO-DATE
[        ] > Task :app:cleanMergeDebugAssets
[        ] > Task :app:mergeDebugShaders UP-TO-DATE
[        ] > Task :app:compileDebugShaders UP-TO-DATE
[        ] > Task :app:generateDebugAssets UP-TO-DATE
[        ] > Task :camera:mergeDebugShaders UP-TO-DATE
[        ] > Task :camera:compileDebugShaders UP-TO-DATE
[        ] > Task :camera:generateDebugAssets UP-TO-DATE
[        ] > Task :camera:packageDebugAssets UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:mergeDebugShaders
UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:compileDebugShaders
UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:generateDebugAssets
UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:packageDebugAssets
UP-TO-DATE
[        ] > Task :integration_test:mergeDebugShaders UP-TO-DATE
[        ] > Task :integration_test:compileDebugShaders UP-TO-DATE
[        ] > Task :integration_test:generateDebugAssets UP-TO-DATE
[        ] > Task :integration_test:packageDebugAssets UP-TO-DATE
[        ] > Task :path_provider:mergeDebugShaders UP-TO-DATE
[        ] > Task :path_provider:compileDebugShaders UP-TO-DATE
[        ] > Task :path_provider:generateDebugAssets UP-TO-DATE
[        ] > Task :path_provider:packageDebugAssets UP-TO-DATE
[        ] > Task :video_player:mergeDebugShaders UP-TO-DATE
[        ] > Task :video_player:compileDebugShaders UP-TO-DATE
[        ] > Task :video_player:generateDebugAssets UP-TO-DATE
[        ] > Task :video_player:packageDebugAssets UP-TO-DATE
[        ] > Task :app:mergeDebugAssets
[ +189 ms] > Task :app:copyFlutterAssetsDebug
[        ] > Task :app:mainApkListPersistenceDebug UP-TO-DATE
[        ] > Task :app:generateDebugResValues UP-TO-DATE
[        ] > Task :app:generateDebugResources UP-TO-DATE
[        ] > Task :app:mergeDebugResources UP-TO-DATE
[        ] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[        ] > Task :app:processDebugManifest UP-TO-DATE
[  +98 ms] > Task :app:processDebugResources UP-TO-DATE
[        ] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :app:compileDebugSources UP-TO-DATE
[   +2 ms] > Task :app:processDebugJavaRes NO-SOURCE
[   +8 ms] > Task :camera:processDebugJavaRes NO-SOURCE
[        ] > Task :camera:bundleLibResDebug UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:processDebugJavaRes
NO-SOURCE
[        ] > Task :flutter_plugin_android_lifecycle:bundleLibResDebug
UP-TO-DATE
[        ] > Task :integration_test:processDebugJavaRes NO-SOURCE
[        ] > Task :integration_test:bundleLibResDebug UP-TO-DATE
[        ] > Task :path_provider:processDebugJavaRes NO-SOURCE
[        ] > Task :path_provider:bundleLibResDebug UP-TO-DATE
[        ] > Task :video_player:processDebugJavaRes NO-SOURCE
[        ] > Task :video_player:bundleLibResDebug UP-TO-DATE
[        ] > Task :app:mergeDebugJavaResource UP-TO-DATE
[        ] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[        ] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[        ] > Task :app:mergeExtDexDebug UP-TO-DATE
[        ] > Task :path_provider:bundleLibRuntimeDebug UP-TO-DATE
[        ] > Task :path_provider:createFullJarDebug UP-TO-DATE
[        ] > Task :video_player:bundleLibRuntimeDebug UP-TO-DATE
[        ] > Task :video_player:createFullJarDebug UP-TO-DATE
[        ] > Task :integration_test:bundleLibRuntimeDebug UP-TO-DATE
[        ] > Task :integration_test:createFullJarDebug UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:bundleLibRuntimeDebug UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:createFullJarDebug
UP-TO-DATE
[  +83 ms] > Task :camera:bundleLibRuntimeDebug UP-TO-DATE
[        ] > Task :camera:createFullJarDebug UP-TO-DATE
[        ] > Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
[        ] > Task :app:mergeProjectDexDebug UP-TO-DATE
[        ] > Task :app:validateSigningDebug UP-TO-DATE
[        ] > Task :app:signingConfigWriterDebug UP-TO-DATE
[        ] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :camera:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :camera:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :camera:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task
:camera:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:mergeDebugNativeLibs
UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:transformNativeLibsWithIntermediateJni
LibsForDebug UP-TO-DATE
[        ] > Task :integration_test:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :integration_test:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :integration_test:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task
:integration_test:transformNativeLibsWithIntermediateJniLibsForDebug
UP-TO-DATE
[        ] > Task :path_provider:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :path_provider:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :path_provider:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task
:path_provider:transformNativeLibsWithIntermediateJniLibsForDebug
UP-TO-DATE
[        ] > Task :video_player:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :video_player:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :video_player:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task
:video_player:transformNativeLibsWithIntermediateJniLibsForDebug
UP-TO-DATE
[        ] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task :app:mergeLibDexDebug UP-TO-DATE
[        ] > Task :app:packageDebug UP-TO-DATE
[ +289 ms] > Task :app:assembleDebug
[        ] > Task :camera:extractDebugAnnotations UP-TO-DATE
[        ] > Task :camera:mergeDebugGeneratedProguardFiles UP-TO-DATE
[        ] > Task :camera:mergeDebugConsumerProguardFiles UP-TO-DATE
[        ] > Task :camera:prepareLintJarForPublish UP-TO-DATE
[        ] > Task :camera:mergeDebugJavaResource UP-TO-DATE
[        ] > Task
:camera:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
[        ] > Task :camera:transformNativeLibsWithSyncJniLibsForDebug
UP-TO-DATE
[        ] > Task :camera:bundleDebugAar UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:extractDebugAnnotations UP-TO-DATE
[        ] > Task :camera:mergeDebugResources UP-TO-DATE
[        ] > Task :camera:compileDebugSources UP-TO-DATE
[        ] > Task :camera:assembleDebug UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:mergeDebugGeneratedProguardFiles
UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:mergeDebugConsumerProguardFiles
UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:prepareLintJarForPublish UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:mergeDebugJavaResource UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:transformClassesAndResourcesWithSyncLi
bJarsForDebug UP-TO-DATE
[        ] > Task
:flutter_plugin_android_lifecycle:transformNativeLibsWithSyncJniLibsForD
ebug UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:bundleDebugAar
UP-TO-DATE
[        ] > Task :integration_test:extractDebugAnnotations UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:mergeDebugResources
UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:compileDebugSources
UP-TO-DATE
[        ] > Task :flutter_plugin_android_lifecycle:assembleDebug
UP-TO-DATE
[        ] > Task :integration_test:mergeDebugGeneratedProguardFiles
UP-TO-DATE
[        ] > Task :integration_test:mergeDebugConsumerProguardFiles
UP-TO-DATE
[        ] > Task :integration_test:prepareLintJarForPublish UP-TO-DATE
[  +88 ms] > Task :integration_test:mergeDebugJavaResource UP-TO-DATE
[        ] > Task
:integration_test:transformClassesAndResourcesWithSyncLibJarsForDebug
UP-TO-DATE
[        ] > Task
:integration_test:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
[        ] > Task :integration_test:bundleDebugAar UP-TO-DATE
[        ] > Task :integration_test:compileDebugSources UP-TO-DATE
[        ] > Task :integration_test:assembleDebug UP-TO-DATE
[        ] > Task :path_provider:extractDebugAnnotations UP-TO-DATE
[        ] > Task :path_provider:mergeDebugGeneratedProguardFiles
UP-TO-DATE
[        ] > Task :path_provider:mergeDebugConsumerProguardFiles
UP-TO-DATE
[        ] > Task :path_provider:prepareLintJarForPublish UP-TO-DATE
[        ] > Task :path_provider:mergeDebugJavaResource UP-TO-DATE
[        ] > Task
:path_provider:transformClassesAndResourcesWithSyncLibJarsForDebug
UP-TO-DATE
[        ] > Task
:path_provider:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
[        ] > Task :path_provider:bundleDebugAar UP-TO-DATE
[        ] > Task :video_player:extractDebugAnnotations UP-TO-DATE
[        ] > Task :path_provider:mergeDebugResources UP-TO-DATE
[        ] > Task :path_provider:compileDebugSources UP-TO-DATE
[        ] > Task :path_provider:assembleDebug UP-TO-DATE
[        ] > Task :video_player:mergeDebugGeneratedProguardFiles
UP-TO-DATE
[        ] > Task :video_player:mergeDebugConsumerProguardFiles
UP-TO-DATE
[        ] > Task :video_player:prepareLintJarForPublish UP-TO-DATE
[        ] > Task :video_player:mergeDebugJavaResource UP-TO-DATE
[        ] > Task
:video_player:transformClassesAndResourcesWithSyncLibJarsForDebug
UP-TO-DATE
[        ] > Task
:video_player:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
[        ] > Task :video_player:bundleDebugAar UP-TO-DATE
[        ] > Task :video_player:mergeDebugResources UP-TO-DATE
[        ] > Task :video_player:compileDebugSources UP-TO-DATE
[        ] > Task :video_player:assembleDebug UP-TO-DATE
[        ] BUILD SUCCESSFUL in 6s
[        ] 175 actionable tasks: 5 executed, 170 up-to-date
[ +399 ms] Running Gradle task 'assembleDebug'... (completed in 7,1s)
[ +114 ms] calculateSha: LocalDirectory:
'/home/user/data/git/plugins/packages/camera/camera/example/build/ap
p/outputs/flutter-apk'/app.apk
[ +509 ms] ✓  Built build/app/outputs/flutter-apk/app-debug.apk.
[   +3 ms] executing:
/home/user/dev/Android/sdk/build-tools/30.0.3/aapt dump xmltree
/home/user/data/git/plugins/packages/camera/camera/example/build/app
/outputs/flutter-apk/app.apk AndroidManifest.xml
[   +8 ms] Exit code 0 from:
/home/user/dev/Android/sdk/build-tools/30.0.3/aapt dump xmltree
/home/user/data/git/plugins/packages/camera/camera/example/build/app
/outputs/flutter-apk/app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1d
               A: android:compileSdkVersionCodename(0x01010573)="10"
               (Raw: "10")
               A: package="io.flutter.plugins.cameraexample" (Raw:
               "io.flutter.plugins.cameraexample")
               A: platformBuildVersionCode=(type 0x10)0x1d
               A: platformBuildVersionName=(type 0x10)0xa
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x15
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-feature (line=11)
                 A: android:name(0x01010003)="android.hardware.camera"
                 (Raw: "android.hardware.camera")
                 A: android:required(0x0101028e)=(type 0x12)0xffffffff
               E: uses-permission (line=15)
                 A:
                 android:name(0x01010003)="android.permission.INTERNET"
                 (Raw: "android.permission.INTERNET")
               E: uses-permission (line=16)
                 A:
                 android:name(0x01010003)="android.permission.FLASHLIGHT
                 " (Raw: "android.permission.FLASHLIGHT")
               E: uses-permission (line=17)
                 A: android:name(0x01010003)="android.permission.CAMERA"
                 (Raw: "android.permission.CAMERA")
               E: uses-permission (line=18)
                 A:
                 android:name(0x01010003)="android.permission.RECORD_AUD
                 IO" (Raw: "android.permission.RECORD_AUDIO")
               E: uses-permission (line=19)
                 A:
                 android:name(0x01010003)="android.permission.ACCESS_NET
                 WORK_STATE" (Raw:
                 "android.permission.ACCESS_NETWORK_STATE")
               E: application (line=21)
                 A: android:label(0x01010001)="camera_example" (Raw:
                 "camera_example")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A:
                 android:appComponentFactory(0x0101057a)="androidx.core.
                 app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=26)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A:
                   android:name(0x01010003)="io.flutter.embedding.androi
                   d.FlutterActivity" (Raw:
                   "io.flutter.embedding.android.FlutterActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type
                   0x11)0x24b4
                   A: android:windowSoftInputMode(0x0101022b)=(type
                   0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type
                   0x12)0xffffffff
                   E: intent-filter (line=33)
                     E: action (line=34)
                       A:
                       android:name(0x01010003)="android.intent.action.M
                       AIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=36)
                       A:
                       android:name(0x01010003)="android.intent.category
                       .LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=40)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw:
                   "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[   +4 ms] Stopping app 'app.apk' on sdk gphone64 x86 64.
[        ] executing: /home/user/dev/Android/sdk/platform-tools/adb
-s emulator-5554 shell am force-stop io.flutter.plugins.cameraexample
[  +25 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
-s emulator-5554 shell pm list packages io.flutter.plugins.cameraexample
[  +31 ms] package:io.flutter.plugins.cameraexample
[   +3 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
-s emulator-5554 shell cat
/data/local/tmp/sky.io.flutter.plugins.cameraexample.sha1
[  +30 ms] 0d902a51fbee4058ee09fb9f39283c443510dba4
[        ] Latest build already installed.
[        ] executing: /home/user/dev/Android/sdk/platform-tools/adb
-s emulator-5554 shell -x logcat -v time -t 1
[  +52 ms] --------- beginning of main
           10-30 18:25:24.076 D/CarrierSvcBindHelper(  891): No carrier
           app for: 0
[  +15 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
-s emulator-5554 shell am start -a android.intent.action.RUN -f
0x20000000 --ez enable-background-compilation true --ez
enable-dart-profiling true --ez enable-checked-mode true --ez
verify-entry-points true
io.flutter.plugins.cameraexample/io.flutter.embedding.android.FlutterAct
ivity
[  +33 ms] Starting: Intent { act=android.intent.action.RUN
flg=0x20000000
cmp=io.flutter.plugins.cameraexample/io.flutter.embedding.android.Flutte
rActivity (has extras) }
[        ] Waiting for observatory port to be available...
[ +336 ms] Observatory URL on device:
http://127.0.0.1:35705/1OLmqTg1gvY=/
[   +1 ms] executing: /home/user/dev/Android/sdk/platform-tools/adb
-s emulator-5554 forward tcp:0 tcp:35705
[  +11 ms] 39861
[        ] Forwarded host port 39861 to device port 35705 for
Observatory
[  +12 ms] Caching compiled dill
[ +114 ms] Connecting to service protocol:
http://127.0.0.1:39861/1OLmqTg1gvY=/
[ +204 ms] Launching a Dart Developer Service (DDS) instance at
http://127.0.0.1:0, connecting to VM service at
http://127.0.0.1:39861/1OLmqTg1gvY=/.
[ +155 ms] DDS is listening at http://127.0.0.1:39163/upuyDm2JFFA=/.
[  +62 ms] Successfully connected to service protocol:
http://127.0.0.1:39861/1OLmqTg1gvY=/
[  +69 ms] DevFS: Creating new filesystem on the device (null)
[  +20 ms] DevFS: Created new filesystem on the device
(file:///data/user/0/io.flutter.plugins.cameraexample/code_cache/example
HKGOJA/example/)
[   +4 ms] Updating assets
[ +108 ms] Syncing files to device sdk gphone64 x86 64...
[   +1 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[   +2 ms] <- recompile package:camera_example/main.dart
c7f93da5-9a90-4a9e-b4cf-c2ea77d49a62
[        ] <- c7f93da5-9a90-4a9e-b4cf-c2ea77d49a62
[  +61 ms] Updating files.
[        ] DevFS: Sync finished
[   +1 ms] Syncing files to device sdk gphone64 x86 64... (completed in
67ms)
[   +1 ms] Synced 0.0MB.
[   +2 ms] <- accept
[   +9 ms] Connected to _flutterView/0x704383b59150.
[   +3 ms] Flutter run key commands.
[   +1 ms] r Hot reload. 🔥🔥🔥
[   +1 ms] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application
running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] 💪 Running with sound null safety 💪
[        ] An Observatory debugger and profiler on sdk gphone64 x86 64
is available
           at: http://127.0.0.1:39163/upuyDm2JFFA=/
[ +306 ms] D/skia    ( 7120): Shader compilation error
[        ] D/skia    ( 7120): ------------------------
[        ] D/skia    ( 7120): Errors:
[        ] D/skia    ( 7120): 
[   +2 ms] D/skia    ( 7120): Shader compilation error
[        ] D/skia    ( 7120): ------------------------
[        ] D/skia    ( 7120): Errors:
[        ] D/skia    ( 7120): 
[   +5 ms] D/skia    ( 7120): Shader compilation error
[        ] D/skia    ( 7120): ------------------------
[        ] D/skia    ( 7120): Errors:
[        ] D/skia    ( 7120): 
[   +7 ms] D/skia    ( 7120): Shader compilation error
[        ] D/skia    ( 7120): ------------------------
[        ] D/skia    ( 7120): Errors:
[        ] D/skia    ( 7120): 
[ +100 ms] Activating Dart DevTools...
[+2464 ms] I/Camera  ( 7120): startPreview
[   +6 ms] I/Camera  ( 7120): Updating builder settings
[        ] D/Camera  ( 7120): Updating builder with feature:
ExposureLockFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
ExposurePointFeature
[   +2 ms] D/Camera  ( 7120): Updating builder with feature:
ZoomLevelFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
AutoFocusFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
NoiseReductionFeature
[        ] I/Camera  ( 7120): updateNoiseReduction | currentSetting:
fast
[        ] D/Camera  ( 7120): Updating builder with feature:
FocusPointFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
ResolutionFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
SensorOrientationFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
FlashFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
ExposureOffsetFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
FpsRangeFeature
[ +419 ms] D/EGL_emulation( 7120): app_time_stats: avg=1475.85ms
min=3.27ms max=2948.44ms count=2
[  +67 ms] D/skia    ( 7120): Shader compilation error
[        ] D/skia    ( 7120): ------------------------
[        ] D/skia    ( 7120): Errors:
[        ] D/skia    ( 7120): 
[   +2 ms] D/skia    ( 7120): Shader compilation error
[        ] D/skia    ( 7120): ------------------------
[        ] D/skia    ( 7120): Errors:
[        ] D/skia    ( 7120): 
[ +928 ms] D/EGL_emulation( 7120): app_time_stats: avg=33.34ms
min=9.52ms max=93.26ms count=30
[ +197 ms] Activating Dart DevTools... (completed in 4,1s)
[ +386 ms] I/Camera  ( 7120): runPrecaptureSequence
[  +20 ms] D/CameraCaptureCallback( 7120): CameraCaptureCallback |
state: STATE_WAITING_PRECAPTURE_START | afState: 0 | aeState: 2
[  +26 ms] D/CameraCaptureCallback( 7120): CameraCaptureCallback |
state: STATE_WAITING_PRECAPTURE_DONE | afState: 0 | aeState: 2
[        ] I/Camera  ( 7120): captureStillPicture
[  +29 ms] D/Camera  ( 7120): Updating builder with feature:
ExposureLockFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
ExposurePointFeature
[   +3 ms] D/Camera  ( 7120): Updating builder with feature:
ZoomLevelFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
AutoFocusFeature
[   +2 ms] D/Camera  ( 7120): Updating builder with feature:
NoiseReductionFeature
[        ] I/Camera  ( 7120): updateNoiseReduction | currentSetting:
fast
[        ] D/Camera  ( 7120): Updating builder with feature:
FocusPointFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
ResolutionFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
SensorOrientationFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
FlashFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
ExposureOffsetFeature
[        ] D/Camera  ( 7120): Updating builder with feature:
FpsRangeFeature
[   +1 ms] I/Camera  ( 7120): sending capture request
[  +28 ms] D/CameraCaptureCallback( 7120): CameraCaptureCallback |
state: STATE_CAPTURING | afState: 0 | aeState: 2
[        ] D/CameraCaptureCallback( 7120): CameraCaptureCallback |
state: STATE_CAPTURING | afState: 0 | aeState: 2
[  +30 ms] D/CameraCaptureCallback( 7120): CameraCaptureCallback |
state: STATE_CAPTURING | afState: 0 | aeState: 5
[  +30 ms] D/CameraCaptureCallback( 7120): CameraCaptureCallback |
state: STATE_CAPTURING | afState: 0 | aeState: 5
[  +26 ms] I/Camera  ( 7120): unlockAutoFocus
[  +21 ms] The Flutter DevTools debugger and profiler on sdk gphone64
x86 64 is
           available at:

http://127.0.0.1:9102?uri=http://127.0.0.1:39163/upuyDm2JFFA=/
[  +73 ms] I/Camera  ( 7120): open | onError
[        ] I/Camera  ( 7120): close
[        ] I/Camera  ( 7120): closeCaptureSession
[  +11 ms] E/CameraCaptureSession( 7120): Session 0: Exception while
stopping repeating: 
[        ] E/CameraCaptureSession( 7120):
android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The
camera device has encountered a serious error
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInEr
ror(CameraDeviceImpl.java:2340)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDevic
eImpl.java:1267)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptu
reSessionImpl.java:579)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1085)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera.close(Camera.java:1092)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera$1.onError(Camera.java:291)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.notifyError(CameraDeviceI
mpl.java:1738)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.$r8$lambda$KBQCqQRdhVVn7u
HI9Xdha6OqnsU(Unknown Source:0)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl$$ExternalSyntheticLambda0
.accept(Unknown Source:8)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(Pool
edLambdaImpl.java:278)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(Pooled
LambdaImpl.java:201)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.
java:97)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Handler.handleCallback(Handler.java:938)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Handler.dispatchMessage(Handler.java:99)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Looper.loopOnce(Looper.java:201)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Looper.loop(Looper.java:288)
[        ] E/CameraCaptureSession( 7120):       at
android.os.HandlerThread.run(HandlerThread.java:67)

Analyzing example...                                                   
No issues found! (ran in 6.5s)
[✓] Flutter (Channel stable, 2.5.3, on Fedora 34 (Workstation Edition) 5.14.12-200.fc34.x86_64, locale ru_RU.UTF-8)
    • Flutter version 2.5.3 at /home/user/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (12 дней назад), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/user/dev/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/chromium-freeworld

[✓] Linux toolchain - develop for Linux desktop
    • clang version 12.0.1 (Fedora 12.0.1-1.fc34)
    • cmake version 3.20.5
    • ninja version 1.10.2
    • pkg-config version 1.7.3

[✓] Android Studio (version 2020.3)
    • Android Studio at /home/user/dev/Android/android-studio
    • Flutter plugin version 61.2.2
    • Dart plugin version 203.8430
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] IntelliJ IDEA Community Edition (version 2021.2)
    • IntelliJ at /home/user/bin/intellij-idea
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Fedora 34 (Workstation Edition) 5.14.12-200.fc34.x86_64
    • Chrome (web)    • chrome • web-javascript • Chromium 94.0.4606.81
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Nov 1, 2021
@danagbemava-nc
Copy link
Member

Reproducible on stable and master.

Similar to #61544.
This could be an issue with the emulator hardware as the "selfie" camera works with the same code.

Camera version:
camera: ^0.9.4+3

emulator info
Name: Pixel_4a_API_31

CPU/ABI: Google APIs ARM (arm64-v8a)

Path: /Users/nexus/.android/avd/Pixel_4a_API_31.avd

Target: google_apis [Google APIs] (API level 31)

Skin: pixel_4a

SD Card: 512 MB

fastboot.chosenSnapshotFile: 

runtime.network.speed: full

hw.accelerometer: yes

hw.device.name: pixel_4a

hw.lcd.width: 1080

hw.initialOrientation: Portrait

image.androidVersion.api: 31

tag.id: google_apis

hw.mainKeys: no

hw.camera.front: emulated

avd.ini.displayname: Pixel 4a API 31

hw.gpu.mode: auto

hw.ramSize: 2048

PlayStore.enabled: false

fastboot.forceColdBoot: no

hw.cpu.ncore: 4

hw.keyboard: yes

hw.sensors.proximity: yes

hw.dPad: no

hw.lcd.height: 2340

vm.heapSize: 256

skin.dynamic: yes

hw.device.manufacturer: Google

hw.gps: yes

hw.audioInput: yes

image.sysdir.1: system-images/android-31/google_apis/arm64-v8a/

showDeviceFrame: yes

hw.camera.back: virtualscene

AvdId: Pixel_4a_API_31

hw.lcd.density: 440

hw.arc: false

hw.device.hash2: MD5:a71dbdf58af14a724eb82b86d3f87030

fastboot.forceChosenSnapshotBoot: no

fastboot.forceFastBoot: yes

hw.trackBall: no

hw.battery: yes

hw.sdCard: yes

tag.display: Google APIs

runtime.network.latency: none

disk.dataPartition.size: 8G

hw.sensors.orientation: yes

avd.ini.encoding: UTF-8

hw.gpu.enabled: yes
logs
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
W/FlutterActivityAndFragmentDelegate( 8417): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Connecting to VM Service at ws://127.0.0.1:49429/ijy0pAaN_k0=/ws
I/CameraManagerGlobal( 8417): Connecting to camera service
I/Camera  ( 8417): startPreview
I/Camera  ( 8417): Updating builder settings
D/Camera  ( 8417): Updating builder with feature: ExposureLockFeature
D/Camera  ( 8417): Updating builder with feature: ExposurePointFeature
D/Camera  ( 8417): Updating builder with feature: ZoomLevelFeature
D/Camera  ( 8417): Updating builder with feature: AutoFocusFeature
D/Camera  ( 8417): Updating builder with feature: NoiseReductionFeature
I/Camera  ( 8417): updateNoiseReduction | currentSetting: fast
D/Camera  ( 8417): Updating builder with feature: FocusPointFeature
D/Camera  ( 8417): Updating builder with feature: ResolutionFeature
D/Camera  ( 8417): Updating builder with feature: SensorOrientationFeature
D/Camera  ( 8417): Updating builder with feature: FlashFeature
D/Camera  ( 8417): Updating builder with feature: ExposureOffsetFeature
D/Camera  ( 8417): Updating builder with feature: FpsRangeFeature
D/EGL_emulation( 8417): app_time_stats: avg=110737.15ms min=14.20ms max=221460.09ms count=2
D/HostConnection( 8417): createUnique: call
D/HostConnection( 8417): HostConnection::get() New Host Connection established 0xb4000079f16a2150, tid 8480
D/HostConnection( 8417): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
D/HostConnection( 8417): createUnique: call
D/HostConnection( 8417): HostConnection::get() New Host Connection established 0xb4000079f16a22d0, tid 8433
D/HostConnection( 8417): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
D/HostConnection( 8417): createUnique: call
D/HostConnection( 8417): HostConnection::get() New Host Connection established 0xb4000079f16a1790, tid 8432
D/HostConnection( 8417): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation( 8417): app_time_stats: avg=35.39ms min=2.91ms max=127.09ms count=28
D/HostConnection( 8417): createUnique: call
D/HostConnection( 8417): HostConnection::get() New Host Connection established 0xb4000079f16a3890, tid 8485
D/HostConnection( 8417): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation( 8417): app_time_stats: avg=33.93ms min=27.61ms max=52.99ms count=30
D/HostConnection( 8417): createUnique: call
D/HostConnection( 8417): HostConnection::get() New Host Connection established 0xb4000079f16a2750, tid 8486
D/HostConnection( 8417): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation( 8417): app_time_stats: avg=34.37ms min=16.32ms max=53.92ms count=30
I/Camera  ( 8417): runPrecaptureSequence
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_WAITING_PRECAPTURE_START | afState: 0 | aeState: 2
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_WAITING_PRECAPTURE_DONE | afState: 0 | aeState: 2
I/Camera  ( 8417): captureStillPicture
D/Camera  ( 8417): Updating builder with feature: ExposureLockFeature
D/Camera  ( 8417): Updating builder with feature: ExposurePointFeature
D/Camera  ( 8417): Updating builder with feature: ZoomLevelFeature
D/Camera  ( 8417): Updating builder with feature: AutoFocusFeature
D/Camera  ( 8417): Updating builder with feature: NoiseReductionFeature
I/Camera  ( 8417): updateNoiseReduction | currentSetting: fast
D/Camera  ( 8417): Updating builder with feature: FocusPointFeature
D/Camera  ( 8417): Updating builder with feature: ResolutionFeature
D/Camera  ( 8417): Updating builder with feature: SensorOrientationFeature
D/Camera  ( 8417): Updating builder with feature: FlashFeature
D/Camera  ( 8417): Updating builder with feature: ExposureOffsetFeature
D/Camera  ( 8417): Updating builder with feature: FpsRangeFeature
I/Camera  ( 8417): sending capture request
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_CAPTURING | afState: 0 | aeState: 2
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_CAPTURING | afState: 0 | aeState: 2
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_CAPTURING | afState: 0 | aeState: 5
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_CAPTURING | afState: 0 | aeState: 5
I/Camera  ( 8417): unlockAutoFocus
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_CAPTURING | afState: 0 | aeState: 5
D/CameraCaptureCallback( 8417): CameraCaptureCallback | state: STATE_CAPTURING | afState: 0 | aeState: 5
I/Camera  ( 8417): open | onError
I/Camera  ( 8417): close
I/Camera  ( 8417): closeCaptureSession
E/CameraCaptureSession( 8417): Session 0: Exception while stopping repeating:
E/CameraCaptureSession( 8417): android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error
E/CameraCaptureSession( 8417): 	at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2350)
E/CameraCaptureSession( 8417): 	at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1277)
E/CameraCaptureSession( 8417): 	at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:579)
E/CameraCaptureSession( 8417): 	at io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1085)
E/CameraCaptureSession( 8417): 	at io.flutter.plugins.camera.Camera.close(Camera.java:1092)
E/CameraCaptureSession( 8417): 	at io.flutter.plugins.camera.Camera$1.onError(Camera.java:291)
E/CameraCaptureSession( 8417): 	at android.hardware.camera2.impl.CameraDeviceImpl.notifyError(CameraDeviceImpl.java:1748)
E/CameraCaptureSession( 8417): 	at android.hardware.camera2.impl.CameraDeviceImpl.$r8$lambda$KBQCqQRdhVVn7uHI9Xdha6OqnsU(Unknown Source:0)
E/CameraCaptureSession( 8417): 	at android.hardware.camera2.impl.CameraDeviceImpl$$ExternalSyntheticLambda0.accept(Unknown Source:8)
E/CameraCaptureSession( 8417): 	at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:281)
E/CameraCaptureSession( 8417): 	at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:204)
E/CameraCaptureSession( 8417): 	at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97)
E/CameraCaptureSession( 8417): 	at android.os.Handler.handleCallback(Handler.java:938)
E/CameraCaptureSession( 8417): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/CameraCaptureSession( 8417): 	at android.os.Looper.loopOnce(Looper.java:201)
E/CameraCaptureSession( 8417): 	at android.os.Looper.loop(Looper.java:288)
E/CameraCaptureSession( 8417): 	at android.os.HandlerThread.run(HandlerThread.java:67)
Application finished.
Exited (sigterm)
flutter doctor -v
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-arm, locale en-GB)
    • Flutter version 2.5.3 at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (2 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.0, Build version 13A233
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 11.6 20G165 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.54

• No issues found!
[✓] Flutter (Channel master, 2.6.0-12.0.pre.535, on macOS 11.6 20G165 darwin-arm, locale en-GB)
    • Flutter version 2.6.0-12.0.pre.535 at /Users/nexus/dev/sdks/flutters
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 04156b6636 (2 days ago), 2021-10-29 18:29:31 -0700
    • Engine revision 3a0a63c2d2
    • Dart version 2.15.0 (build 2.15.0-262.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 11.6 20G165 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.54

• No issues found!

@danagbemava-nc danagbemava-nc added found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin p: first party platform-android Android applications specifically and removed in triage Presently being triaged by the triage team labels Nov 1, 2021
@danagbemava-nc
Copy link
Member

@proninyaroslav, do you only experience this with an android 12 emulator?

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 1, 2021
@proninyaroslav
Copy link
Author

@danagbemava-nc
I don't have a real Android 12 device, so I can't check this.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 1, 2021
@danagbemava-nc
Copy link
Member

@proninyaroslav
I was asking if you experienced this with only the android 12 emulator or other emulators as well

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 1, 2021
@proninyaroslav
Copy link
Author

@danagbemava-nc
Other emulators are working fine, so I pointed out that the problem only with Android 12

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 1, 2021
@danagbemava-nc
Copy link
Member

I wanted to be certain because I can reproduce on an emulator with API 29.

@danagbemava-nc danagbemava-nc added the c: crash Stack traces logged to the console label Nov 1, 2021
@danagbemava-nc danagbemava-nc changed the title [camera] Android 12 emulator camera crash when take a photo [camera] Android 12 emulator camera throws CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error when take a photo Nov 1, 2021
@danagbemava-nc danagbemava-nc changed the title [camera] Android 12 emulator camera throws CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error when take a photo [camera] Android emulator camera throws CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error when take a photo Nov 1, 2021
@danagbemava-nc danagbemava-nc changed the title [camera] Android emulator camera throws CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error when take a photo [camera] Android emulator camera throws CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error when taking a photo Nov 1, 2021
@proninyaroslav
Copy link
Author

@danagbemava-nc
I tested the behavior on API 29, everything is ok

@stuartmorgan-g stuartmorgan-g added the P2 Important issues not at the top of the work list label Nov 4, 2021
@maheshj01
Copy link
Member

maheshj01 commented Nov 5, 2021

Labeling this issue as OS version specific based on above two comments #92762 (comment), #92762 (comment)

@maheshj01 maheshj01 added the e: OS-version specific Affects only some versions of the relevant operating system label Nov 5, 2021
@remideneleaodocs
Copy link

We are using the wechat_camera_picker package which depends on the Flutter camera package and we are seeing the same exception on an Android 12 (API 31) emulator.

After setting up and testing on a fresh new Flutter project with just the code from the example page of the camera package:

  • we are seeing the same exception on an Android 12 (API 31) emulator,
  • when running on a physical device (Pixel 6 Pro), there is no exception but an infinite loop in CameraCaptureCallback | state: STATE_CAPTURING as described in #92973.

Tested with camera 0.9.4+4 and 0.9.4+5 versions.

@DamirDautov
Copy link

so this does happen for me on ^0.9.4+19 with how the emulator is setup by default. I was able to get this working however by setting the advanced settings in the AVD manager to emulate the back camera.

+1, camera in virtual scene doesn't work for me on v0.9.4+20, but emulated camera is OK

@faisalhameed321
Copy link

Device Manager>Edit>Show Advanced Settings>Camera>Back, change from virtual scene to emulated, and the emulator can take picture now for me.

@gazcn007
Copy link

gazcn007 commented Jul 7, 2022

im on camera: ^0.9.8+1, still running into this issue with Huawei Mate Xs from time to time,
logs:

E/CameraCaptureSession: Session 0: Exception while stopping repeating: 
    android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error
        at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2534)
        at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1131)
        at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:526)
        at io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1169)
        at io.flutter.plugins.camera.Camera.close(Camera.java:1176)
        at io.flutter.plugins.camera.Camera$1.onError(Camera.java:358)
        at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.notifyError(CameraDeviceImpl.java:2022)
        at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.lambda$Sm85frAzwGZVMAK-NE_gwckYXVQ(Unknown Source:0)
        at android.hardware.camera2.impl.-$$Lambda$CameraDeviceImpl$CameraDeviceCallbacks$Sm85frAzwGZVMAK-NE_gwckYXVQ.accept(Unknown Source:8)
        at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:271)
        at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:195)
        at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:86)
        at android.os.Handler.handleCallback(Handler.java:900)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:219)
        at android.os.HandlerThread.run(HandlerThread.java:67)

@musiolmarco
Copy link

I have now tried many things and unfortunately for me still not everything works on my MacBook Pro 14. Here are my results when testing the camera (It has always been the same error messages as described above):

Emulators on Windows PC:

  • Nexus 4 API30 (Virtual Scene): WORKING
  • Nexus 4 API30 (Emulated): WORKING
  • Pixel 4 API30 (Virtual Scene): WORKING
  • Pixel 4 API30 (Emulated): WORKING
  • Pixel 4 API27 (Virtual Scene): WORKING
  • Pixel 4 API27 (Emulated): WORKING
  • Real Device: WORKING
    So on my Windows computer everything works fine.

Now I switch to my MacBook Pro 14 (2021), the following problems occur:

  • Pixel 4 API33 (Virtual Scene): NOT WORKING
  • Pixel 4 API29 (Virtual Scene): NOT WORKING
  • Pixel 3 API29 (Virtual Scene): NOT WORKING

Then I figured out it's only working if I set the Front camera to 'Emulated' in Android Studio settings:

  • Pixel 4 API33 (Emulated): WORKING
  • Pixel 4 API29 (Emulated): WORKING
  • Pixel 3 API29 (Emulated): WORKING

Then I tested the API30 and there it worked for Virtual Scene and Emulated, the only problem was that the Virtual Scene in API30 looked exactly like the Emulated version. That means you couldn't move around in the room either and only had this weird pixel image. However, I need the Virtual Scene or an image so that I can test the app, since the app should analyze a certain image.

Has anyone found a solution to this problem?

@mansourmoufid
Copy link

If there is a function/symbol named "dump_buffer" in any shared library loaded by dlopen(), your ACameraCaptureSession will fail and onCaptureFailed() will be called with the reason CAPTURE_FAILURE_REASON_ERROR.

In logcat you will see errors like this (as mentioned in #issue-1064149287):

W/libc: Unable to set property "debug.sf.dequeuebuffer" to "1": connection failed; errno=13 (Permission denied)
E/BufferQueueProducer: [ImageReader-1088x1088f23u3m1-22596-0](id:584400000000,api:4,p:823,c:22596) waitForFreeSlotThenRelock: timeout

Check your jniLibs directory for the symbol "dump_buffer":

pip install androidenv
python -m androidenv /bin/sh -c "llvm-nm app/src/main/jniLibs/arm64-v8a/*" | grep dump_buffer

What a funny bug...

@maheshj01
Copy link
Member

Everyone who is affected by this issue please leave an upvote on the original report, Upvotes are a good indication of affected users and it is one among many factors which helps the flutter team to prioritize the issue.

@MohamedSafvanKP-MSIL
Copy link

Device: Redmi note 11 pro 5G (MIUI 13, android version 11)
The camera comes with one black screen.
Plugin Used up to camera 0.10.0+4

logs getting on camera plugin 0.10.0+4

Syncing files to device 2201116SI...
I/CameraManagerGlobal(22595): Connecting to camera service
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 2
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 3
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 4
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 5
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 6
I/CameraMetadataJV(22595): setAppNameAndSensorId all [com.antutu:0,ssize,12032x9024,0,false]
I/CameraMetadataJV(22595): setAppNameAndSensorId all [com.antutu:1,ssize,4608x3456,0,false]
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 2
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 3
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 4
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 5
I/flutter (22595): ====================CAMERA===================
I/flutter (22595): CameraDescription(0, CameraLensDirection.back, 90)
I/flutter (22595): CameraDescription(1, CameraLensDirection.front, 270)
I/flutter (22595): ====================CAMERA===================
I/flutter (22595): ====================CAMERA===================
I/flutter (22595): CameraDescription(0, CameraLensDirection.back, 90)
I/flutter (22595): CameraDescription(1, CameraLensDirection.front, 270)
I/flutter (22595): ====================CAMERA===================
E/LB      (22595): fail to open file: No such file or directory
I/mple.camerates(22595): ProcessProfilingInfo new_methods=1016 is saved saved_to_disk=1 resolve_classes_delay=8000
D/FrameIndicator(22595): support status: 1 0x79d0332018 0x79d03324c4
W/Camera  (22595): The selected imageFormatGroup is not supported by Android. Defaulting to yuv420
D/FrameIndicator(22595): support status: 1 0x79d0332018 0x79d03324c4
D/CameraInjector(22595): notifyRF for API 2 : cameraRoleId = 1, active = true
D/CameraInjector(22595): notifyRF cameraId = 1, active ? true
I/Camera  (22595): startPreview
D/FrameIndicator(22595): support status: 1 0x79d0332018 0x79d03324c4
I/Camera  (22595): CameraCaptureSession onConfigured
I/Camera  (22595): Updating builder settings
D/Camera  (22595): Updating builder with feature: ExposureLockFeature
D/Camera  (22595): Updating builder with feature: ExposurePointFeature
D/Camera  (22595): Updating builder with feature: ZoomLevelFeature
D/Camera  (22595): Updating builder with feature: AutoFocusFeature
D/Camera  (22595): Updating builder with feature: NoiseReductionFeature
I/Camera  (22595): updateNoiseReduction | currentSetting: fast
D/Camera  (22595): Updating builder with feature: FocusPointFeature
D/Camera  (22595): Updating builder with feature: ResolutionFeature
D/Camera  (22595): Updating builder with feature: SensorOrientationFeature
D/Camera  (22595): Updating builder with feature: FlashFeature
D/Camera  (22595): Updating builder with feature: ExposureOffsetFeature
D/Camera  (22595): Updating builder with feature: FpsRangeFeature
I/Camera  (22595): refreshPreviewCaptureSession
I/Camera  (22595): open | onError
I/Camera  (22595): close
D/CameraInjector(22595): notifyRF for API 2 : cameraRoleId = 1, active = false
D/CameraInjector(22595): notifyRF cameraId = 1, active ? false
W/BpBinder(22595): Slow Binder: BpBinder transact took 802 ms, interface=android.hardware.camera2.ICameraDeviceUser, code=1 oneway=false
I/Camera  (22595): open | onClosed
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 5
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 5
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 3
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 3
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 2
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 2
W/CameraManagerGlobal(22595): ignore the torch status update of camera: 4
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 4
W/CameraManagerGlobal(22595): [soar.cts] ignore the status update of camera: 6
E/CameraManagerGlobal(22595): Camera 4 is not available. Ignore physical camera status change

And logs on camera plugin 0.9.2+2

I/Camera  (17719): open | onError
I/Camera  (17719): close
I/Camera  (17719): closeCaptureSession
E/CameraCaptureSession(17719): Session 0: Exception while stopping repeating: 
E/CameraCaptureSession(17719): android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error
E/CameraCaptureSession(17719): 	at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2327)
E/CameraCaptureSession(17719): 	at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1273)
E/CameraCaptureSession(17719): 	at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:579)
E/CameraCaptureSession(17719): 	at io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1086)
E/CameraCaptureSession(17719): 	at io.flutter.plugins.camera.Camera.close(Camera.java:1093)
E/CameraCaptureSession(17719): 	at io.flutter.plugins.camera.Camera$1.onError(Camera.java:294)
E/CameraCaptureSession(17719): 	at android.hardware.camera2.impl.CameraDeviceImpl.notifyError(CameraDeviceImpl.java:1725)
E/CameraCaptureSession(17719): 	at android.hardware.camera2.impl.CameraDeviceImpl.lambda$oDs27OTfKFfK18rUW2nQxxkPdV0(Unknown Source:0)
E/CameraCaptureSession(17719): 	at android.hardware.camera2.impl.-$$Lambda$CameraDeviceImpl$oDs27OTfKFfK18rUW2nQxxkPdV0.accept(Unknown Source:8)
E/CameraCaptureSession(17719): 	at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:278)
E/CameraCaptureSession(17719): 	at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:201)
E/CameraCaptureSession(17719): 	at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97)
E/CameraCaptureSession(17719): 	at android.os.Handler.handleCallback(Handler.java:938)
E/CameraCaptureSession(17719): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/CameraCaptureSession(17719): 	at android.os.Looper.loop(Looper.java:237)
E/CameraCaptureSession(17719): 	at android.os.HandlerThread.run(HandlerThread.java:67)
D/CameraInjector(17719): notifyRF for API 2 : cameraRoleId = 1, active = false
D/CameraInjector(17719): notifyRF cameraId = 1, active ? false

Source code:

import 'dart:async';
import 'dart:io';

import 'package:camera/camera.dart';
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MaterialApp(home: MenuCamera()));
}

class MenuCamera extends StatefulWidget {
  const MenuCamera({Key? key}) : super(key: key);

  @override
  _MenuCameraState createState() => _MenuCameraState();
}

class _MenuCameraState extends State<MenuCamera> {

  Future<CameraDescription> camera() async {
    WidgetsFlutterBinding.ensureInitialized();

    // Obtain a list of the available cameras on the device.
    final cameras = await availableCameras();

    // Get a specific camera from the list of available cameras.
    var firstCamera = cameras[1];
    print('====================CAMERA===================');
    print(cameras[0]);
    print(firstCamera);
    print('====================CAMERA===================');

    return firstCamera;
  }

  @override
  void initState() {
    camera();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.blueGrey,
      body: FutureBuilder<CameraDescription>(
          future: camera(),
          builder: (context,AsyncSnapshot snapshot) {
            if (snapshot.data == null) {
              return const Center(
                child: CircularProgressIndicator(),
              );
            }
            return TakePictureScreen(
              camera: snapshot.data,
            );
          }),
    );
  }
}

// A screen that allows users to take a picture using a given camera.
class TakePictureScreen extends StatefulWidget {
  const TakePictureScreen({
    required this.camera,
  });

  final CameraDescription camera;

  @override
  TakePictureScreenState createState() => TakePictureScreenState();
}

class TakePictureScreenState extends State<TakePictureScreen> {
  late CameraController _controller;
  late Future<void> _initializeControllerFuture;

  @override
  void initState() {
    super.initState();
    // To display the current output from the Camera,
    // create a CameraController.
    _controller = CameraController(
      // Get a specific camera from the list of available cameras.
      widget.camera,
      // Define the resolution to use.
      ResolutionPreset.max,
    );

    // Next, initialize the controller. This returns a Future.
    _initializeControllerFuture = _controller.initialize();
  }

  @override
  void dispose() {
    // Dispose of the controller when the widget is disposed.
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Take a picture')),
      // You must wait until the controller is initialized before displaying the
      // camera preview. Use a FutureBuilder to display a loading spinner until the
      // controller has finished initializing.
      body: FutureBuilder<void>(
        future: _initializeControllerFuture,
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            // If the Future is complete, display the preview.
            return CameraPreview(_controller);
          } else {
            // Otherwise, display a loading indicator.
            return const Center(child: CircularProgressIndicator());
          }
        },
      ),
      floatingActionButton: FloatingActionButton(
        // Provide an onPressed callback.
        onPressed: () async {
          // Take the Picture in a try / catch block. If anything goes wrong,
          // catch the error.
          try {
            // Ensure that the camera is initialized.
            await _initializeControllerFuture;

            // Attempt to take a picture and get the file `image`
            // where it was saved.
            final image = await _controller.takePicture();

            // If the picture was taken, display it on a new screen.
            await Navigator.of(context).push(
              MaterialPageRoute(
                builder: (context) => DisplayPictureScreen(
                  // Pass the automatically generated path to
                  // the DisplayPictureScreen widget.
                  imagePath: image.path,
                ),
              ),
            );
          } catch (e) {
            // If an error occurs, log the error to the console.
            print(e);
          }
        },
        child: const Icon(Icons.camera_alt),
      ),
    );
  }
}

// A widget that displays the picture taken by the user.
class DisplayPictureScreen extends StatelessWidget {
  final String imagePath;

  const DisplayPictureScreen({required this.imagePath});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Display the Picture')),
      // The image is stored as a file on the device. Use the `Image.file`
      // constructor with the given path to display the image.
      body: Image.file(File(imagePath)),
    );
  }
}

and pubspec.yaml

name: cameratest
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

environment:
  sdk: '>=2.18.2 <3.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  camera: 0.9.2+2
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

@tannaom29
Copy link

This issue is reproduced in the plugin example, only in Android 12 emulator with the latest plugin version. https://github.com/flutter/plugins/blob/master/packages/camera/camera/example/lib/main.dart

Steps to Reproduce

  1. Run the example, give all permission
  2. Select the main camera, click the capture button

Expected results: Taking a photo must be successful

Actual results: Camera crash occurred:

[  +73 ms] I/Camera  ( 7120): open | onError
[        ] I/Camera  ( 7120): close
[        ] I/Camera  ( 7120): closeCaptureSession
[  +11 ms] E/CameraCaptureSession( 7120): Session 0: Exception while
stopping repeating: 
[        ] E/CameraCaptureSession( 7120):
android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The
camera device has encountered a serious error
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInEr
ror(CameraDeviceImpl.java:2340)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDevic
eImpl.java:1267)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptu
reSessionImpl.java:579)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1085)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera.close(Camera.java:1092)
[        ] E/CameraCaptureSession( 7120):       at
io.flutter.plugins.camera.Camera$1.onError(Camera.java:291)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.notifyError(CameraDeviceI
mpl.java:1738)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl.$r8$lambda$KBQCqQRdhVVn7u
HI9Xdha6OqnsU(Unknown Source:0)
[        ] E/CameraCaptureSession( 7120):       at
android.hardware.camera2.impl.CameraDeviceImpl$$ExternalSyntheticLambda0
.accept(Unknown Source:8)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(Pool
edLambdaImpl.java:278)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(Pooled
LambdaImpl.java:201)
[        ] E/CameraCaptureSession( 7120):       at
com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.
java:97)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Handler.handleCallback(Handler.java:938)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Handler.dispatchMessage(Handler.java:99)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Looper.loopOnce(Looper.java:201)
[        ] E/CameraCaptureSession( 7120):       at
android.os.Looper.loop(Looper.java:288)
[        ] E/CameraCaptureSession( 7120):       at
android.os.HandlerThread.run(HandlerThread.java:67)

Logs

Kindly check this out: https://github.com/tannaom29/Upload_Image_From_Camera_Preview_Flutter_FLASKAPI.git

I have worked upon the code by myself and it's working fluently.

For more queries reach me out @ https://www.linkedin.com/in/omtanna

@MohamedSafvanKP-MSIL
Copy link

MohamedSafvanKP-MSIL commented Jan 30, 2023

logs
Fatal Exception: java.lang.IllegalStateException: CameraDevice was already closed
       at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2236)
       at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureSessionInternal(CameraDeviceImpl.java:658)
       at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureSession(CameraDeviceImpl.java:644)
       at io.flutter.plugins.camera.Camera$DefaultCameraDeviceWrapper.createCaptureSession(Camera.java:175)
       at io.flutter.plugins.camera.Camera.createCaptureSessionWithSessionConfig(Camera.java:479)
       at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:465)
       at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:387)
       at io.flutter.plugins.camera.Camera.startPreview(Camera.java:1074)
       at io.flutter.plugins.camera.Camera$1.onOpened(Camera.java:322)
       at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:246)
       at android.os.HandlerThread.run(HandlerThread.java:67)
logs
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.camera2.CameraCaptureSession.close()' on a null object reference
       at io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1192)
       at io.flutter.plugins.camera.Camera.access$500(Camera.java:100)
       at io.flutter.plugins.camera.Camera$1.onClosed(Camera.java:342)
       at android.hardware.camera2.impl.CameraDeviceImpl$5.run(CameraDeviceImpl.java:255)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:240)
       at android.os.Looper.loop(Looper.java:351)
       at android.os.HandlerThread.run(HandlerThread.java:67)

two crashes caught in my firebase account.
by investigations, It happened at the camera plugin used in flutter modules,
It's happening on android devices only, versions are 9 to 12 versions.
Used plugin details:
camera: ^0.10.0
https://pub.dev/packages/camera

any one can help with this, ?

@stuartmorgan-g
Copy link
Contributor

The initial report here was about emulators, but there is discussion of actual devices above, and it's not clear if those issues have been resolved elsewhere. Is anyone still seeing this specific issue (CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error) on actual devices?

@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team triaged-android Triaged by Android platform team labels Jul 8, 2023
@top-master
Copy link

top-master commented Aug 5, 2023

At least we know that logs like:

W/libc: Unable to set property "debug.sf.dequeuebuffer" to "1": connection failed; errno=13 (Permission denied)
E/BufferQueueProducer: [ImageReader-1088x1088f23u3m1-22596-0](id:584400000000,api:4,p:823,c:22596) waitForFreeSlotThenRelock: timeout

Have nothing to do with this,
and those simply happen whenever app crashes before calling close().

Example

captureImageReader.setOnImageAvailableListener({ reader ->
    try (Image image = reader.acquireLatestImage()) {

        // Do some crash here, and said logs appear.

    } // <- because `image.close()` is called around here.
}, imageReaderHandler);

@tcvi
Copy link

tcvi commented Aug 22, 2023

Got the same error on emulator API 31 (Pixel_4), using the plugin camera 0.10.5+3. How to fix this error ?

@camsim99
Copy link
Contributor

I believe this issue should be fixed in the CameraX implementation of the camera plugin, so please try it out!

If you find a similar issue with that implementation (or any other issues), please feel free to file a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: crash Stack traces logged to the console e: OS-version specific Affects only some versions of the relevant operating system found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: camera The camera plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
Status: [PENDING] camera_android issues solved by camera_android_camerax
Development

No branches or pull requests