juliansteenbakker / mobile_scanner

A universal scanner for Flutter based on MLKit. Uses CameraX on Android and AVFoundation on iOS.
BSD 3-Clause "New" or "Revised" License
880 stars 510 forks source link

Crashing on Android emulator #426

Open mentoc3000 opened 1 year ago

mentoc3000 commented 1 year ago

Steps to reproduce:

  1. Run Android emulator
  2. In the camera settings, load an image of a barcode
  3. Run the example app on tag v3.0.0-beta.4
  4. Tap MobileScanner with Controller
  5. If necessary, move around the rooms to find the bar code
  6. MobileScanner scans the barcode and then crashes
Console Log ``` Launching lib\main.dart on Android SDK built for x86 in debug mode... √ Built build\app\outputs\flutter-apk\app-debug.apk. Connecting to VM Service at ws://127.0.0.1:62541/dE_ZBgYp2Po=/ws D/TransportRuntime.CctTransportBackend( 6256): Making request to: https://firebaselogging.googleapis.com/v0cc/log/batch?format=json_proto3 I/TransportRuntime.CctTransportBackend( 6256): Status Code: 200 I/TransportRuntime.CctTransportBackend( 6256): Content-Type: application/json; charset=UTF-8 I/TransportRuntime.CctTransportBackend( 6256): Content-Encoding: gzip D/TransportRuntime.SQLiteEventStore( 6256): Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct D/TransportRuntime.JobInfoScheduler( 6256): Scheduling upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) with jobId=-2079511396 in 854999ms(Backend next call timestamp 1671135499132). Attempt 1 I/CameraManagerGlobal( 6256): Connecting to camera service D/CameraRepository( 6256): Added camera: 0 I/Camera2CameraInfo( 6256): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED D/CameraRepository( 6256): Added camera: 1 I/Camera2CameraInfo( 6256): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL D/CameraValidator( 6256): Verifying camera lens facing on generic_x86, lensFacingInteger: null D/DeferrableSurface( 6256): Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@8a8444d} D/CameraOrientationUtil( 6256): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90 I/chatty ( 6256): uid=10122(dev.steenbakker.mobile_scanner_example) identical 1 line D/CameraOrientationUtil( 6256): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90 D/DeferrableSurface( 6256): Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.impl.ImmediateSurface@1bdfe50} D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Use case androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960 ACTIVE D/UseCaseAttachState( 6256): Active and attached use case: [] for camera: 0 D/TorchControl( 6256): Unable to enableTorch due to there is no flash unit. D/CameraOrientationUtil( 6256): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90 D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Use case androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153 ACTIVE D/UseCaseAttachState( 6256): Active and attached use case: [] for camera: 0 D/CameraOrientationUtil( 6256): getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90 D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Use cases [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] now ATTACHED D/UseCaseAttachState( 6256): All use case: [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] for camera: 0 D/UseCaseAttachState( 6256): Active and attached use case: [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] for camera: 0 D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Resetting Capture Session D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Releasing session in state INITIALIZED D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Attempting to force open the camera. D/CameraStateRegistry( 6256): tryOpenCamera(Camera@89cb784[id=0]) [Available Cameras: 1, Already Open: false (Previous state: null)] --> SUCCESS D/CameraStateRegistry( 6256): Recalculating open cameras: D/CameraStateRegistry( 6256): Camera State D/CameraStateRegistry( 6256): ------------------------------------------------------------------- D/CameraStateRegistry( 6256): Camera@89cb784[id=0] OPENING D/CameraStateRegistry( 6256): Camera@390c48f[id=1] UNKNOWN D/CameraStateRegistry( 6256): ------------------------------------------------------------------- D/CameraStateRegistry( 6256): Open count: 1 (Max allowed: 1) D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Opening camera. D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING D/CameraStateMachine( 6256): New public camera state CameraState{type=OPENING, error=null} from OPENING and null D/CameraStateMachine( 6256): Publishing new public camera state CameraState{type=OPENING, error=null} D/UseCaseAttachState( 6256): All use case: [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] for camera: 0 D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Use case androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960 ACTIVE D/UseCaseAttachState( 6256): Active and attached use case: [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] for camera: 0 D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Use case androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153 ACTIVE D/UseCaseAttachState( 6256): Active and attached use case: [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] for camera: 0 D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} CameraDevice.onOpened() D/Camera2CameraImpl( 6256): {Camera@89cb784[id=0]} Transitioning camera internal state: OPENING --> OPENED D/CameraStateRegistry( 6256): Recalculating open cameras: D/CameraStateRegistry( 6256): Camera State D/CameraStateRegistry( 6256): ------------------------------------------------------------------- D/CameraStateRegistry( 6256): Camera@89cb784[id=0] OPEN D/CameraStateRegistry( 6256): Camera@390c48f[id=1] UNKNOWN D/CameraStateRegistry( 6256): ------------------------------------------------------------------- D/CameraStateRegistry( 6256): Open count: 1 (Max allowed: 1) D/CameraStateMachine( 6256): New public camera state CameraState{type=OPEN, error=null} from OPEN and null D/CameraStateMachine( 6256): Publishing new public camera state CameraState{type=OPEN, error=null} D/UseCaseAttachState( 6256): All use case: [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] for camera: 0 D/UseCaseAttachState( 6256): Active and attached use case: [androidx.camera.core.Preview-9367a4bc-bdb4-4cba-99be-3369657cc92434299960, androidx.camera.core.ImageAnalysis-ebc91557-2828-4202-a97e-64ced3b4a893158939153] for camera: 0 D/SyncCaptureSessionBase( 6256): [androidx.camera.camera2.internal.SynchronizedCaptureSessionBaseImpl@19bdc0a] getSurface...done D/CaptureSession( 6256): Opening capture session. D/DeferrableSurface( 6256): New surface in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@8a8444d} D/DeferrableSurface( 6256): use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@8a8444d D/DeferrableSurface( 6256): New surface in use[total_surfaces=2, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@1bdfe50} D/DeferrableSurface( 6256): use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@1bdfe50 D/CaptureSession( 6256): Attempting to send capture request onConfigured D/CaptureSession( 6256): Issuing request for session. D/Camera2CaptureRequestBuilder( 6256): createCaptureRequest D/CaptureSession( 6256): CameraCaptureSession.onConfigured() mState=OPENED W/Gralloc4( 6256): allocator 3.x is not supported D/CaptureSession( 6256): CameraCaptureSession.onReady() OPENED D/TransportRuntime.SQLiteEventStore( 6256): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct I/tflite ( 6256): Initialized TensorFlow Lite runtime. I/tflite ( 6256): Created TensorFlow Lite XNNPACK delegate for CPU. I/native ( 6256): I0000 00:00:1671134647.398393 6329 oned_decoder_client.cc:695] barhopper::deep_learning::OnedDecoderClient is created successfully. D/TransportRuntime.JobInfoScheduler( 6256): Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning... I/scanner_exampl( 6256): Background concurrent copying GC freed 61415(5361KB) AllocSpace objects, 16(1216KB) LOS objects, 49% free, 3590KB/7180KB, paused 728us total 556.424ms W/GooglePlayServicesUtil( 6256): dev.steenbakker.mobile_scanner_example requires the Google Play Store, but it is missing. W/GoogleApiManager( 6256): The service for com.google.android.gms.common.internal.service.zap is not available: ConnectionResult{statusCode=SERVICE_INVALID, resolution=null, message=null} D/TransportRuntime.SQLiteEventStore( 6256): Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct D/skia ( 6256): onFlyCompress F/libc ( 6256): Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xb6de8000 in tid 6256 (scanner_example), pid 6256 (scanner_example) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'Android/sdk_phone_x86/generic_x86:11/RSR1.210210.001.A1/7193139:userdebug/dev-keys' Revision: '0' ABI: 'x86' Timestamp: 2022-12-15 15:04:09-0500 pid: 6256, tid: 6256, name: scanner_example >>> dev.steenbakker.mobile_scanner_example <<< uid: 10122 signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xb6de8000 eax eb094d50 ebx b6de7e8c ecx 000000b0 edx eb089cf0 edi 00000140 esi b6de810c ebp ff9d3108 esp ff9d2fc0 eip e845b455 backtrace: #00 pc 001f3455 /system/lib/libhwui.so (Yuv420SpToJpegEncoder::compress(jpeg_compress_struct*, unsigned char*, int*)+837) (BuildId: ee592dc4acb9a2335e7aa2eb2a9284b5) #01 pc 001f30d3 /system/lib/libhwui.so (YuvToJpegEncoder::encode(SkWStream*, void*, int, int, int*, int)+483) (BuildId: ee592dc4acb9a2335e7aa2eb2a9284b5) #02 pc 001f4391 /system/lib/libhwui.so (YuvImage_compressToJpeg(_JNIEnv*, _jobject*, _jbyteArray*, int, int, int, _jintArray*, _jintArray*, int, _jobject*, _jbyteArray*)+273) (BuildId: ee592dc4acb9a2335e7aa2eb2a9284b5) #03 pc 0020f6a8 /system/framework/x86/boot-framework.oat (art_jni_trampoline+328) (BuildId: 6267c422a69286b583c337676c46b2cbf1d3b60c) #04 pc 0013bc72 /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #05 pc 001d0512 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #06 pc 00386881 /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #07 pc 0037be2d /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+829) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #08 pc 007aac00 /apex/com.android.art/lib/libart.so (MterpInvokeStaticRange+464) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #09 pc 00135da1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_static_range+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #10 pc 003dd760 /system/framework/framework.jar (android.graphics.YuvImage.compressToJpeg+112) #11 pc 007a335e /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+1806) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #12 pc 00135921 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #13 pc 000067a0 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~JJHw0L-eYy2qLJMU4FvisA==/dev.steenbakker.mobile_scanner_example-1-F6aGgVCYaKFRDp6XQ4QA==/base.apk!classes2.dex] (dev.steenbakker.mobile_scanner.MobileScannerUtilitiesKt.toByteArray+172) #14 pc 007a6ebe /apex/com.android.art/lib/libart.so (MterpInvokeStatic+1454) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #15 pc 00135aa1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #16 pc 000053ec [anon:dalvik-classes2.dex extracted in memory from /data/app/~~JJHw0L-eYy2qLJMU4FvisA==/dev.steenbakker.mobile_scanner_example-1-F6aGgVCYaKFRDp6XQ4QA==/base.apk!classes2.dex] (dev.steenbakker.mobile_scanner.MobileScanner$captureOutput$1$1.invoke+380) #17 pc 007a335e /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+1806) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #18 pc 00135921 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #19 pc 0000522a [anon:dalvik-classes2.dex extracted in memory from /data/app/~~JJHw0L-eYy2qLJMU4FvisA==/dev.steenbakker.mobile_scanner_example-1-F6aGgVCYaKFRDp6XQ4QA==/base.apk!classes2.dex] (dev.steenbakker.mobile_scanner.MobileScanner$captureOutput$1$1.invoke+6) #20 pc 007a53be /apex/com.android.art/lib/libart.so (MterpInvokeInterface+2126) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #21 pc 00135b21 /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #22 pc 000077d2 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~JJHw0L-eYy2qLJMU4FvisA==/dev.steenbakker.mobile_scanner_example-1-F6aGgVCYaKFRDp6XQ4QA==/base.apk!classes2.dex] (dev.steenbakker.mobile_scanner.MobileScanner.captureOutput$lambda$4$lambda$0+10) #23 pc 007a6ebe /apex/com.android.art/lib/libart.so (MterpInvokeStatic+1454) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #24 pc 00135aa1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #25 pc 000075a0 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~JJHw0L-eYy2qLJMU4FvisA==/dev.steenbakker.mobile_scanner_example-1-F6aGgVCYaKFRDp6XQ4QA==/base.apk!classes2.dex] (dev.steenbakker.mobile_scanner.MobileScanner.$r8$lambda$Xyl92QJ03zSuYHfA13P9NMHVVVc) #26 pc 007a6ebe /apex/com.android.art/lib/libart.so (MterpInvokeStatic+1454) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #27 pc 00135aa1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #28 pc 00005068 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~JJHw0L-eYy2qLJMU4FvisA==/dev.steenbakker.mobile_scanner_example-1-F6aGgVCYaKFRDp6XQ4QA==/base.apk!classes2.dex] (dev.steenbakker.mobile_scanner.MobileScanner$$ExternalSyntheticLambda6.onSuccess+4) #29 pc 007a53be /apex/com.android.art/lib/libart.so (MterpInvokeInterface+2126) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #30 pc 00135b21 /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #31 pc 002b73aa [anon:dalvik-classes.dex extracted in memory from /data/app/~~JJHw0L-eYy2qLJMU4FvisA==/dev.steenbakker.mobile_scanner_example-1-F6aGgVCYaKFRDp6XQ4QA==/base.apk] (com.google.android.gms.tasks.zzm.run+50) #32 pc 007a53be /apex/com.android.art/lib/libart.so (MterpInvokeInterface+2126) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #33 pc 00135b21 /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #34 pc 0036f5d8 /system/framework/framework.jar (offset 0x92b000) (android.os.Handler.handleCallback+4) #35 pc 007a6ebe /apex/com.android.art/lib/libart.so (MterpInvokeStatic+1454) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #36 pc 00135aa1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #37 pc 0036f444 /system/framework/framework.jar (offset 0x92b000) (android.os.Handler.dispatchMessage+8) #38 pc 007a335e /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+1806) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #39 pc 00135921 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #40 pc 00396c4a /system/framework/framework.jar (offset 0x92b000) (android.os.Looper.loop+482) #41 pc 0036fc82 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.10914192770458939989)+370) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #42 pc 00379d9f /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+207) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #43 pc 0037b635 /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+2117) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #44 pc 0018e793 /apex/com.android.art/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp(art::interpreter::SwitchImplContext*)+81395) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #45 pc 00142f62 /apex/com.android.art/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #46 pc 001a17c0 /system/framework/framework.jar (android.app.ActivityThread.main) #47 pc 0036fc0e /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.10914192770458939989)+254) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #48 pc 00379c80 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #49 pc 0078d185 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #50 pc 0014238d /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #51 pc 0013bc72 /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #52 pc 001d0512 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #53 pc 00631e68 /apex/com.android.art/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+1464) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #54 pc 0058a500 /apex/com.android.art/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+80) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #55 pc 0008a778 /apex/com.android.art/javalib/x86/boot.oat (art_jni_trampoline+168) (BuildId: b386118502376442aa402e8d28c29e95a6eb8614) #56 pc 0013baa2 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #57 pc 001d0501 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #58 pc 00386881 /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #59 pc 0037abbe /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #60 pc 007a3017 /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+967) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #61 pc 00135921 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #62 pc 00449446 /system/framework/framework.jar (offset 0x125d000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22) #63 pc 0036fc82 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.10914192770458939989)+370) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #64 pc 00379c80 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #65 pc 0078d185 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #66 pc 0014238d /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #67 pc 00893656 /system/framework/x86/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2102) (BuildId: 6267c422a69286b583c337676c46b2cbf1d3b60c) #68 pc 0013bc72 /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #69 pc 001d0512 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #70 pc 006304b3 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, char*)+579) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #71 pc 00630985 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, char*)+85) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #72 pc 004cf63f /apex/com.android.art/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+735) (BuildId: bf39832c4acabbc939d5c516b6f1d211) #73 pc 0008f90e /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+62) (BuildId: 93b8a76261a5d972cc69b8b7c6e74be9) #74 pc 00098c8e /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector const&, bool)+910) (BuildId: 93b8a76261a5d972cc69b8b7c6e74be9) #75 pc 00003804 /system/bin/app_process32 (main+1588) (BuildId: c5eedbfb6130af84c3db8e121fb1202e) #76 pc 000522e3 /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+115) (BuildId: 6e3a0180fa6637b68c0d181c343e6806) Lost connection to device. Exited (sigterm) ```
Flutter doctor ``` [!] Flutter (Channel unknown, 3.3.8, on Microsoft Windows [Version 10.0.19045.2364], locale en-US) ! Flutter version 3.3.8 on channel unknown at C:\git\flutter ! Upstream repository unknown • Framework revision 52b3dc25f6 (5 weeks ago), 2022-11-09 12:09:26 +0800 • Engine revision 857bd6b74c • Dart version 2.18.4 • DevTools version 2.15.0 [√] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at C:\Users\XXXXX\AppData\Local\Android\sdk • Platform android-33, build-tools 32.0.0 • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [!] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.8) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools • Visual Studio Build Tools 2019 version 16.11.32002.261 • Windows 10 SDK version 10.0.19041.0 X The current Visual Studio installation is incomplete. Please reinstall Visual Studio. [!] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 45.1.1 • Dart plugin version 192.7761 X Unable to determine bundled Java version. • Try updating or re-installing Android Studio. [√] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio1 • 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.12+7-b1504.28-7817840) [√] VS Code (version 1.70.0) • VS Code at C:\Users\XXXXX\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.15.0 [√] Connected device (4 available) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.2364] • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.99 • Edge (web) • edge • web-javascript • Microsoft Edge 103.0.1264.71 [√] HTTP Host Availability • All required HTTP hosts are available ```

This may be the same issue raised in #403.

ilikerobots commented 1 year ago

I have the same issue; Problem is related to yuvImage.compressToJpeg, which seems like it shouldn't be called if returnImages is false, but apparently is. I forked with this change to workaround since i don't need captured images, however it's a clumsy fix.

mattscicluna2 commented 1 year ago

Are there any fixes for this please?

mattscicluna2 commented 1 year ago

Any solution @juliansteenbakker ?

3M35 commented 1 year ago

Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr

Have the same error on 3.0.0.

LeoleoSt commented 1 year ago

_Fatal signal 11 (SIGSEGV), code 1 (SEGVMAPERR), fault addr 0x4163f001 in tid 7064

Have the same error on 3.0.0. Windows 10, emulator Pixel 4 XL API 31

michael-markl commented 1 year ago

529 solves the issue for the case that returnImage is not specified as true.

yagizdo commented 1 year ago

Android 11 crash issue still persists. None of the solutions I tried worked.

Console Log:

... Launching lib/main.dart on sdk gphone arm64 in debug mode... Running Gradle task 'assembleDebug'... ✓ Built build/app/outputs/flutter-apk/app-debug.apk. Debug service listening on ws://127.0.0.1:61798/XTLwcPWpLKE=/ws Syncing files to device sdk gphone arm64... I/flutter ( 8588): [🌎 Easy Localization] [DEBUG] Localization initialized [GETX] Instance "NetworkController" has been created [GETX] Instance "NetworkController" has been initialized I/flutter ( 8588): [🌎 Easy Localization] [DEBUG] Start I/flutter ( 8588): [🌎 Easy Localization] [DEBUG] Init state I/flutter ( 8588): [🌎 Easy Localization] [DEBUG] Build I/flutter ( 8588): [🌎 Easy Localization] [DEBUG] Init Localization Delegate I/flutter ( 8588): [🌎 Easy Localization] [DEBUG] Init provider I/flutter ( 8588): [🌎 Easy Localization] [DEBUG] Load Localization Delegate [GETX] Instance "GetMaterialController" has been created [GETX] Instance "GetMaterialController" has been initialized I/flutter ( 8588): Called start() while starting. D/TransportRuntime.SQLiteEventStore( 8588): Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct I/CameraManagerGlobal( 8588): Connecting to camera service D/TransportRuntime.JobInfoScheduler( 8588): Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning... D/CameraRepository( 8588): Added camera: 1 I/Camera2CameraInfo( 8588): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL D/CameraValidator( 8588): Verifying camera lens facing on emulator_arm64, lensFacingInteger: null E/CameraValidator( 8588): Camera LensFacing verification failed, existing cameras: [Camera@1d0e71f[id=1]] W/CameraX ( 8588): Retry init. Start time 1443909 current time 1443966 W/CameraX ( 8588): androidx.camera.core.impl.CameraValidator$CameraIdListIncorrectException: Expected camera missing from device. W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:97) W/CameraX ( 8588): at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$2$androidx-camera-core-CameraX(CameraX.java:342) W/CameraX ( 8588): at androidx.camera.core.CameraX$$ExternalSyntheticLambda2.run(Unknown Source:10) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/CameraX ( 8588): at java.lang.Thread.run(Thread.java:923) W/CameraX ( 8588): Caused by: java.lang.IllegalArgumentException: No available camera can be found W/CameraX ( 8588): at androidx.camera.core.CameraSelector.select(CameraSelector.java:82) W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:83) W/CameraX ( 8588): ... 5 more D/CameraRepository( 8588): Added camera: 1 I/Camera2CameraInfo( 8588): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL D/CameraValidator( 8588): Verifying camera lens facing on emulator_arm64, lensFacingInteger: null E/CameraValidator( 8588): Camera LensFacing verification failed, existing cameras: [Camera@9c73b04[id=1]] W/CameraX ( 8588): Retry init. Start time 1443909 current time 1444507 W/CameraX ( 8588): androidx.camera.core.impl.CameraValidator$CameraIdListIncorrectException: Expected camera missing from device. W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:97) W/CameraX ( 8588): at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$2$androidx-camera-core-CameraX(CameraX.java:342) W/CameraX ( 8588): at androidx.camera.core.CameraX$$ExternalSyntheticLambda2.run(Unknown Source:10) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/CameraX ( 8588): at java.lang.Thread.run(Thread.java:923) W/CameraX ( 8588): Caused by: java.lang.IllegalArgumentException: No available camera can be found W/CameraX ( 8588): at androidx.camera.core.CameraSelector.select(CameraSelector.java:82) W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:83) W/CameraX ( 8588): ... 5 more D/CameraRepository( 8588): Added camera: 1 I/Camera2CameraInfo( 8588): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL D/CameraValidator( 8588): Verifying camera lens facing on emulator_arm64, lensFacingInteger: null E/CameraValidator( 8588): Camera LensFacing verification failed, existing cameras: [Camera@8d5e8a5[id=1]] W/CameraX ( 8588): Retry init. Start time 1443909 current time 1445017 W/CameraX ( 8588): androidx.camera.core.impl.CameraValidator$CameraIdListIncorrectException: Expected camera missing from device. W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:97) W/CameraX ( 8588): at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$2$androidx-camera-core-CameraX(CameraX.java:342) W/CameraX ( 8588): at androidx.camera.core.CameraX$$ExternalSyntheticLambda2.run(Unknown Source:10) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/CameraX ( 8588): at java.lang.Thread.run(Thread.java:923) W/CameraX ( 8588): Caused by: java.lang.IllegalArgumentException: No available camera can be found W/CameraX ( 8588): at androidx.camera.core.CameraSelector.select(CameraSelector.java:82) W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:83) W/CameraX ( 8588): ... 5 more D/CameraRepository( 8588): Added camera: 1 I/Camera2CameraInfo( 8588): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL D/CameraValidator( 8588): Verifying camera lens facing on emulator_arm64, lensFacingInteger: null E/CameraValidator( 8588): Camera LensFacing verification failed, existing cameras: [Camera@6fb28d2[id=1]] W/CameraX ( 8588): Retry init. Start time 1443909 current time 1445534 W/CameraX ( 8588): androidx.camera.core.impl.CameraValidator$CameraIdListIncorrectException: Expected camera missing from device. W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:97) W/CameraX ( 8588): at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$2$androidx-camera-core-CameraX(CameraX.java:342) W/CameraX ( 8588): at androidx.camera.core.CameraX$$ExternalSyntheticLambda2.run(Unknown Source:10) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/CameraX ( 8588): at java.lang.Thread.run(Thread.java:923) W/CameraX ( 8588): Caused by: java.lang.IllegalArgumentException: No available camera can be found W/CameraX ( 8588): at androidx.camera.core.CameraSelector.select(CameraSelector.java:82) W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:83) W/CameraX ( 8588): ... 5 more D/CameraRepository( 8588): Added camera: 1 I/Camera2CameraInfo( 8588): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL D/CameraValidator( 8588): Verifying camera lens facing on emulator_arm64, lensFacingInteger: null E/CameraValidator( 8588): Camera LensFacing verification failed, existing cameras: [Camera@c940e1b[id=1]] W/CameraX ( 8588): Retry init. Start time 1443909 current time 1446041 W/CameraX ( 8588): androidx.camera.core.impl.CameraValidator$CameraIdListIncorrectException: Expected camera missing from device. W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:97) W/CameraX ( 8588): at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$2$androidx-camera-core-CameraX(CameraX.java:342) W/CameraX ( 8588): at androidx.camera.core.CameraX$$ExternalSyntheticLambda2.run(Unknown Source:10) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/CameraX ( 8588): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/CameraX ( 8588): at java.lang.Thread.run(Thread.java:923) W/CameraX ( 8588): Caused by: java.lang.IllegalArgumentException: No available camera can be found W/CameraX ( 8588): at androidx.camera.core.CameraSelector.select(CameraSelector.java:82) W/CameraX ( 8588): at androidx.camera.core.impl.CameraValidator.validateCameras(CameraValidator.java:83) W/CameraX ( 8588): ... 5 more D/CameraRepository( 8588): Added camera: 1 I/Camera2CameraInfo( 8588): Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL D/CameraValidator( 8588): Verifying camera lens facing on emulator_arm64, lensFacingInteger: null E/CameraValidator( 8588): Camera LensFacing verification failed, existing cameras: [Camera@b10f9d0[id=1]] E/CameraX ( 8588): The device might underreport the amount of the cameras. Finish the initialize task since we are already reaching the maximum number of retries. D/AndroidRuntime( 8588): Shutting down VM E/AndroidRuntime( 8588): FATAL EXCEPTION: main E/AndroidRuntime( 8588): Process: com.freddo.freddo_mobile_app, PID: 8588 E/AndroidRuntime( 8588): java.lang.IllegalArgumentException: Provided camera selector unable to resolve a camera for the given use case E/AndroidRuntime( 8588): at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:476) E/AndroidRuntime( 8588): at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:363) E/AndroidRuntime( 8588): at dev.steenbakker.mobile_scanner.MobileScanner.start$lambda-11(MobileScanner.kt:191) E/AndroidRuntime( 8588): at dev.steenbakker.mobile_scanner.MobileScanner.$r8$lambda$lZ4oz9drwcwj0DZn-HVtxaofOTE(Unknown Source:0) E/AndroidRuntime( 8588): at dev.steenbakker.mobile_scanner.MobileScanner$$ExternalSyntheticLambda1.run(Unknown Source:14) E/AndroidRuntime( 8588): at android.os.Handler.handleCallback(Handler.java:938) E/AndroidRuntime( 8588): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 8588): at android.os.Looper.loop(Looper.java:223) E/AndroidRuntime( 8588): at android.app.ActivityThread.main(ActivityThread.java:7656) E/AndroidRuntime( 8588): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 8588): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/AndroidRuntime( 8588): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) I/Process ( 8588): Sending signal. PID: 8588 SIG: 9 Lost connection to device. ...