mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.3k stars 1.07k forks source link

🐛 Crash on Android using code scanner #2442

Closed oscar-b closed 7 months ago

oscar-b commented 7 months ago

What's happening?

After reading barcodes using useCodeScanner the app crashes on Android.

Tried with both default pixelFormat and yuv as you suggested.

Reproduceable Code

<Camera
    ref={camera}
    style={StyleSheet.absoluteFill}
    device={device}
    isActive={show}
    codeScanner={codeScanner}
    onError={onError}
    pixelFormat="yuv"
/>

Relevant log output

01-26 10:46:26.355 31206 31206 I PreviewView: Creating PreviewView...
01-26 10:46:26.356 31206 31206 I PreviewView: PreviewView is 0x0, rendering 720x1473 content. Resizing to: 0x0 (COVER)
01-26 10:46:26.358 31206 31206 I CameraView: Updating CameraSession...
01-26 10:46:26.360 31206  1041 I CameraSession: configure { ... }: Waiting for lock...
01-26 10:46:26.362 31206  1041 I CameraSession: configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=true, outputsChanged=true, sidePropsChanged=true, isActiveChanged=true)
01-26 10:46:26.362 31206  1041 I CameraSession: Need to rebuild CameraDevice and CameraCaptureSession...
01-26 10:46:26.362 31206  1041 I CameraSession: CameraDevice and CameraCaptureSession is torn down but Camera is not active, skipping update...
01-26 10:46:26.362 31206  1041 I CameraSession: Successfully updated CameraSession Configuration! isActive: false
01-26 10:46:26.363 31206  1041 I CameraView: invokeOnInitialized()
01-26 10:46:26.486 31206 31206 E unknown:ReactModalHost: Creating new dialog from context: eu.company.my_app.dev.MainActivity@86dfd26@141425958
01-26 10:46:26.532 31206 31206 E unknown:ReactModalHost: Updating existing dialog with context: eu.company.my_app.dev.MainActivity@86dfd26@141425958
01-26 10:46:26.593 31206 31206 I CameraView: Updating CameraSession...
01-26 10:46:26.594 31206  1041 I CameraSession: configure { ... }: Waiting for lock...
01-26 10:46:26.594 31206  1041 I CameraSession: configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=true, outputsChanged=true, sidePropsChanged=true, isActiveChanged=true)
01-26 10:46:26.594 31206  1041 I CameraSession: Need to rebuild CameraDevice and CameraCaptureSession...
01-26 10:46:26.594 31206  1041 I CameraSession: Need to rebuild CameraDevice and CameraCaptureSession...
01-26 10:46:26.594 31206  1041 I CameraSession: Configuring Camera #0...
01-26 10:46:26.595 31206  1041 I CameraManager: Camera #0: Opening...
01-26 10:46:26.599 31206 31206 I PreviewView: PreviewView is 720x1078, rendering 720x1473 content. Resizing to: 720x1473 (COVER)
01-26 10:46:26.618 31206  1041 I CameraManager: Camera #0: Opened!
01-26 10:46:26.623 31206  1041 I CameraSession: Successfully configured Camera #0!
01-26 10:46:26.624 31206  1041 I CameraSession: Destroying previous outputs...
01-26 10:46:26.625 31206   992 I CameraDevices: Camera #0 is now unavailable.
01-26 10:46:26.630 31206  1041 I CameraSession: Creating outputs for Camera #0...
01-26 10:46:26.634 31206 31206 I CameraSession: PreviewView Surface created! Surface(name=null)/@0x6d006ae
01-26 10:46:26.634 31206  1041 I CameraSession: Adding 1280x720 CodeScanner Output in YUV_420_888...
01-26 10:46:26.634 31206 31206 I CameraSession: Setting Preview Output...
01-26 10:46:26.635 31206 31206 I CameraSession: PreviewView Surface updated! Surface(name=null)/@0x6d006ae 720 x 1473
01-26 10:46:26.679 31206 31206 I PreviewView: PreviewView is 720x1132, rendering 720x1473 content. Resizing to: 720x1473 (COVER)
01-26 10:46:26.680 31206  1245 I DynamiteModule: Considering local module com.google.mlkit.dynamite.barcode:10000 and remote module com.google.mlkit.dynamite.barcode:0
01-26 10:46:26.681 31206  1245 I DynamiteModule: Selected local version of com.google.mlkit.dynamite.barcode
01-26 10:46:26.691 31206  1041 I CreateCaptureSession: Camera #0: Creating Capture Session #1... (Hardware Level: 3 | Outputs: [VIDEO (1280 x 720 CodeScanner for [QR, EAN_13, CODE_128, DATA_MATRIX] (35))])
01-26 10:46:26.692 31206  1041 I CreateCaptureSession: Using new API (>=28)
01-26 10:46:26.764 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:26.773 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
01-26 10:46:26.781 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:26.787 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
01-26 10:46:26.849 31206  1041 I CameraSession: configure { ... }: Waiting for lock...
01-26 10:46:26.851 31206  1041 I CreateCaptureSession: Camera #0: Successfully created CameraCaptureSession #1!
01-26 10:46:26.851 31206  1041 I CameraSession: Successfully configured Session with 1 outputs for Camera #0!
01-26 10:46:26.856 31206  1041 I CameraView: invokeOnStarted()
01-26 10:46:26.857 31206  1041 I CameraSession: Successfully updated CameraSession Configuration! isActive: true
01-26 10:46:26.857 31206  1041 I CameraView: invokeOnInitialized()
01-26 10:46:26.859 31206  1041 I CameraSession: configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=false, outputsChanged=true, sidePropsChanged=true, isActiveChanged=false)
01-26 10:46:26.859 31206  1041 I CameraSession: Destroying previous outputs...
01-26 10:46:26.859 31206  1041 I SurfaceOutput: Closing BarcodeScanner..
01-26 10:46:26.860 31206  1041 I CameraView: invokeOnStopped()
01-26 10:46:26.863 31206  1041 I CameraSession: Creating outputs for Camera #0...
01-26 10:46:26.865 31206  1041 I CameraSession: Adding 1280x720 Preview Output...
01-26 10:46:26.866 31206 31206 I PreviewView: Setting PreviewView Surface Size to 720 x 1473...
01-26 10:46:26.868 31206  1041 I CameraSession: Adding 1280x720 CodeScanner Output in YUV_420_888...
01-26 10:46:26.871 31206  1281 I DynamiteModule: Considering local module com.google.mlkit.dynamite.barcode:10000 and remote module com.google.mlkit.dynamite.barcode:0
01-26 10:46:26.871 31206  1281 I DynamiteModule: Selected local version of com.google.mlkit.dynamite.barcode
01-26 10:46:26.872 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:26.872 31206  1041 I CreateCaptureSession: Camera #0: Creating Capture Session #2... (Hardware Level: 3 | Outputs: [PREVIEW (1280 x 720), VIDEO (1280 x 720 CodeScanner for [QR, EAN_13, CODE_128, DATA_MATRIX] (35))])
01-26 10:46:26.873 31206  1041 I CreateCaptureSession: Using new API (>=28)
01-26 10:46:26.875 31206 31206 I CameraSession: PreviewView Surface updated! Surface(name=null)/@0x6d006ae 1280 x 720
01-26 10:46:26.880 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
01-26 10:46:26.898 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:26.905 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
01-26 10:46:26.940 31206 31225 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-0](id:79e600000000,api:4,p:1329,c:31206) dequeueBuffer: BufferQueue has been abandoned
01-26 10:46:27.086 31206  1041 I CreateCaptureSession: Camera #0: Successfully created CameraCaptureSession #2!
01-26 10:46:27.087 31206  1041 I CameraSession: Successfully configured Session with 2 outputs for Camera #0!
01-26 10:46:27.091 31206 31225 I BpBinder: onLastStrongRef automatically unlinking death recipients: <uncached descriptor>
01-26 10:46:27.091 31206  1041 I CameraView: invokeOnStarted()
01-26 10:46:27.092 31206  1041 I CameraSession: Successfully updated CameraSession Configuration! isActive: true
01-26 10:46:27.093 31206  1041 I CreateCaptureSession: Camera #0: CameraCaptureSession #1 has been closed.
01-26 10:46:27.297 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:27.305 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
01-26 10:46:27.309 31206  1316 I tflite  : Initialized TensorFlow Lite runtime.
01-26 10:46:27.312 31206  1316 E libc    : Access denied finding property "ro.hardware.chipname"
01-26 10:46:27.315 31206  1316 I tflite  : Created TensorFlow Lite XNNPACK delegate for CPU.
01-26 10:46:27.315 31206  1316 I tflite  : Replacing 43 out of 43 node(s) with delegate (TfLiteXNNPackDelegate) node, yielding 1 partitions for the whole graph.
01-26 10:46:27.319 31206  1316 I tflite  : Replacing 42 out of 47 node(s) with delegate (TfLiteXNNPackDelegate) node, yielding 11 partitions for the whole graph.
01-26 10:46:27.322 31206  1316 I native  : I0000 00:00:1706262387.322330    1316 oned_decoder_client.cc:695] barhopper::deep_learning::OnedDecoderClient is created successfully.
01-26 10:46:27.399 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:27.405 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
01-26 10:46:27.409 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:27.418 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
01-26 10:46:28.706 31206 31220 I qr.my_app.de: Background concurrent copying GC freed 162130(8980KB) AllocSpace objects, 11(1060KB) LOS objects, 50% free, 16MB/32MB, paused 98us total 134.397ms
01-26 10:46:31.374 31206 31206 I CameraSession: PreviewView Surface destroyed! Surface(name=null)/@0x6d006ae
01-26 10:46:31.374 31206 31206 I CameraSession: Destroying Preview Output...
01-26 10:46:31.375 31206 31206 I CameraSession: configure { ... }: Waiting for lock...
01-26 10:46:31.375 31206 31206 I CameraSession: configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=false, outputsChanged=true, sidePropsChanged=true, isActiveChanged=false)
01-26 10:46:31.375 31206 31206 I CameraSession: Destroying previous outputs...
01-26 10:46:31.375 31206 31206 I SurfaceOutput: Closing BarcodeScanner..
01-26 10:46:31.377 31206 31206 I CameraView: invokeOnStopped()
01-26 10:46:31.380 31206 31206 I CameraSession: Creating outputs for Camera #0...
01-26 10:46:31.382 31206 31206 I CameraSession: Adding 1280x720 CodeScanner Output in YUV_420_888...
01-26 10:46:31.386 31206 31206 I CreateCaptureSession: Camera #0: Creating Capture Session #3... (Hardware Level: 3 | Outputs: [VIDEO (1280 x 720 CodeScanner for [QR, EAN_13, CODE_128, DATA_MATRIX] (35))])
01-26 10:46:31.386 31206 31206 I CreateCaptureSession: Using new API (>=28)
01-26 10:46:31.389 31206 31230 D TransportRuntime.SQLiteEventStore: Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct
01-26 10:46:31.395 31206 31230 D TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
--------- beginning of crash
01-26 10:46:31.402 31206  1319 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6c2b769e20 in tid 1319 (pool-13-thread-), pid 31206 (qr.my_app.dev)
01-26 10:46:31.403 31206 31226 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-1](id:79e600000001,api:4,p:1329,c:31206) queueBuffer: BufferQueue has been abandoned
01-26 10:46:31.437 31206 31226 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-1](id:79e600000001,api:4,p:1329,c:31206) queueBuffer: BufferQueue has been abandoned
01-26 10:46:31.471 31206 31226 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-1](id:79e600000001,api:4,p:1329,c:31206) queueBuffer: BufferQueue has been abandoned
01-26 10:46:31.544 31206   990 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-1](id:79e600000001,api:4,p:1329,c:31206) queueBuffer: BufferQueue has been abandoned
01-26 10:46:31.548 31206 31226 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-1](id:79e600000001,api:4,p:1329,c:31206) queueBuffer: BufferQueue has been abandoned
01-26 10:46:31.572 31206 31226 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-1](id:79e600000001,api:4,p:1329,c:31206) queueBuffer: BufferQueue has been abandoned
01-26 10:46:31.602 31206 31226 E BufferQueueProducer: [ImageReader-1280x720f23m2-31206-1](id:79e600000001,api:4,p:1329,c:31206) queueBuffer: BufferQueue has been abandoned
01-26 10:46:31.716 31206  1041 I CreateCaptureSession: Camera #0: Successfully created CameraCaptureSession #3!
01-26 10:46:31.717 31206 31206 I CameraSession: Successfully configured Session with 1 outputs for Camera #0!
01-26 10:46:31.723 31206 31226 I BpBinder: onLastStrongRef automatically unlinking death recipients: <uncached descriptor>
01-26 10:46:31.725 31206 31206 I CameraView: invokeOnStarted()
01-26 10:46:31.727 31206 31206 I CameraSession: Successfully updated CameraSession Configuration! isActive: true
01-26 10:46:31.729 31206 31206 I CameraSession: Preview Output destroyed!
01-26 10:46:31.737 31206  1041 I CreateCaptureSession: Camera #0: CameraCaptureSession #2 has been closed.
01-26 10:46:31.740 31206 31206 I CameraView: Updating CameraSession...
01-26 10:46:31.741 31206  1041 I CameraSession: configure { ... }: Waiting for lock...
01-26 10:46:31.742 31206  1041 I CameraSession: configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=true, outputsChanged=true, sidePropsChanged=true, isActiveChanged=true)
01-26 10:46:31.742 31206  1041 I CameraSession: isActive is false, skipping CameraDevice configuration.
01-26 10:46:31.742 31206  1041 I CameraSession: isActive is false, skipping CameraCaptureSession configuration.
01-26 10:46:31.742 31206  1041 I CameraView: invokeOnStopped()
01-26 10:46:31.744 31206  1041 I CameraSession: Successfully updated CameraSession Configuration! isActive: false
01-26 10:46:31.745 31206  1041 I CameraView: invokeOnInitialized()
01-26 10:46:31.772 31206 31206 I CameraSession: Closing CameraSession...
01-26 10:46:31.773 31206 31206 I CameraSession: Destroying session..
01-26 10:46:31.858 31206 31206 I SurfaceOutput: Closing BarcodeScanner..
01-26 10:46:31.859 31206 31206 I CameraSession: CameraSession closed!
01-26 10:46:31.864 31206   992 I CameraDevices: Camera #0 is now available.

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-right",
  "hardwareLevel": "full",
  "maxZoom": 8,
  "minZoom": 1,
  "maxExposure": 12,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": true,
  "isMultiCam": false,
  "minFocusDistance": 10,
  "minExposure": -12,
  "name": "BACK (0)",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"
}

Device

Android Motorola Defy (Android 11)

VisionCamera Version

3.8.2

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

mrousavy commented 7 months ago

Hey - seems like the logs just cut off, there is no tombstone there? Can you post the full logs

oscar-b commented 7 months ago

Hey - seems like the logs just cut off, there is no tombstone there? Can you post the full logs

I'm on vacation without access to the test device right now, but I'm quite sure that's all there was in the logs. The logs are from adb logcat so maybe doesn't have it all?

xiongxiongjiang commented 7 months ago

i have same problem in my app one time scan 2 time then crash the android app plz solve my problem

+1 same here

mrousavy commented 7 months ago

plz solve my problem

@Devyadav3001 lol, plz pay me to solve ur problem

mrousavy commented 7 months ago

Hey - seems like the logs just cut off, there is no tombstone there? Can you post the full logs

I'm on vacation without access to the test device right now, but I'm quite sure that's all there was in the logs. The logs are from adb logcat so maybe doesn't have it all?

Okay yea no I think there should've been something afterwards, because the tombstone isn't there it's just the message that something has crashed.

You see:

--------- beginning of crash

there should also be a end of crash.

Anyways, have a nice rest of your vacation - let me know if you find the logs when you're back :)

mrousavy commented 7 months ago

Working on a fix for this issue here: https://github.com/mrousavy/react-native-vision-camera/pull/2494 👀

Still in development, so don't test yet. Long way to go, this is a really complicated issue (as you can see in the changes/Files of that PR)...

tatiana-lonestone commented 7 months ago

Hello,

I have the same kind of error : after reading barcodes using useCodeScanner, the app crashes on Android randomly.

But my logcat is different, so maybe it can help ?


2024-02-02 17:24:41.393 14562-16177 y-package          com.my-package                W  Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
2024-02-02 17:24:41.394 14562-16177 y-package          com.my-package                W  Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
2024-02-02 17:24:41.509 14562-16178 y-package          com.my-package                W  Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
2024-02-02 17:24:41.509 14562-16178 y-package          com.my-package                W  Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
2024-02-02 17:24:41.531 14562-14562 CameraSession           com.my-package                I  PreviewView Surface destroyed! Surface(name=null)/@0x77e9c8c
2024-02-02 17:24:41.531 14562-14562 CameraSession           com.my-package                I  Destroying Preview Output...
2024-02-02 17:24:41.534 14562-14562 CameraSession           com.my-package                I  configure { ... }: Waiting for lock...
2024-02-02 17:24:41.534 14562-14562 CameraSession           com.my-package                I  configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=false, outputsChanged=true, sidePropsChanged=true, isActiveChanged=false)
2024-02-02 17:24:41.534 14562-14562 CameraSession           com.my-package                I  Destroying previous outputs...
2024-02-02 17:24:41.534 14562-14562 SurfaceOutput           com.my-package                I  Closing BarcodeScanner..
2024-02-02 17:24:41.536 14562-14562 CameraView              com.my-package                I  invokeOnStopped()
2024-02-02 17:24:41.543 14562-14562 CameraSession           com.my-package                I  Creating outputs for Camera #0...
2024-02-02 17:24:41.548 14562-14562 CameraSession           com.my-package                I  Adding 1280x720 CodeScanner Output in YUV_420_888...
2024-02-02 17:24:41.554 14562-14562 CreateCaptureSession    com.my-package                I  Camera #0: Creating Capture Session #3... (Hardware Level: 3 | Outputs: [VIDEO (1280 x 720 CodeScanner for [CODE_128] (35))])
2024-02-02 17:24:41.555 14562-14562 CreateCaptureSession    com.my-package                I  Using new API (>=28)
2024-02-02 17:24:41.566 14562-16008 BufferQueueProducer     com.my-package                E  [ImageReader-1280x720f23m2-14562-1] queueBuffer: BufferQueue has been abandoned
2024-02-02 17:24:41.608 14562-16008 BufferQueueProducer     com.my-package                E  [ImageReader-1280x720f23m2-14562-1] queueBuffer: BufferQueue has been abandoned
2024-02-02 17:24:41.645 14562-16008 BufferQueueProducer     com.my-package                E  [ImageReader-1280x720f23m2-14562-1] queueBuffer: BufferQueue has been abandoned
2024-02-02 17:24:41.742 14562-16186 BufferQueueProducer     com.my-package                E  [ImageReader-1280x720f23m2-14562-1] queueBuffer: BufferQueue has been abandoned
2024-02-02 17:24:41.757 14562-16179 libc                    com.my-package                A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7b673b59c0 in tid 16179 (pool-11-thread-), pid 14562 (y-packages)
2024-02-02 17:24:41.814 14562-16099 CreateCaptureSession    com.my-package                I  Camera #0: Successfully created CameraCaptureSession #3!
2024-02-02 17:24:41.815 14562-16099 CreateCaptureSession    com.my-package                I  Camera #0: CameraCaptureSession #2 has been closed.
2024-02-02 17:24:41.815 14562-14562 CameraSession           com.my-package                I  Successfully configured Session with 1 outputs for Camera #0!
2024-02-02 17:24:41.815 14562-16099 CameraSession           com.my-package                I  Camera Session android.hardware.camera2.impl.CameraCaptureSessionImpl@8a05784 has been closed.
2024-02-02 17:24:41.821 14562-14562 CameraView              com.my-package                I  invokeOnStarted()
2024-02-02 17:24:41.822 14562-14562 CameraSession           com.my-package                I  Successfully updated CameraSession Configuration! isActive: true
2024-02-02 17:24:41.822 14562-14562 CameraSession           com.my-package                I  Preview Output destroyed!
2024-02-02 17:24:41.875 14562-14562 CameraView              com.my-package                I  Updating CameraSession...
2024-02-02 17:24:41.876 14562-16099 CameraSession           com.my-package                I  configure { ... }: Waiting for lock...
2024-02-02 17:24:41.876 14562-16099 CameraSession           com.my-package                I  configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=true, outputsChanged=true, sidePropsChanged=true, isActiveChanged=true)
2024-02-02 17:24:41.876 14562-16099 CameraSession           com.my-package                I  isActive is false, skipping CameraDevice configuration.
2024-02-02 17:24:41.876 14562-16099 CameraSession           com.my-package                I  isActive is false, skipping CameraCaptureSession configuration.
2024-02-02 17:24:41.876 14562-16099 CameraView              com.my-package                I  invokeOnStopped()
2024-02-02 17:24:41.878 14562-16099 CameraSession           com.my-package                I  Successfully updated CameraSession Configuration! isActive: false
2024-02-02 17:24:41.878 14562-16099 CameraView              com.my-package                I  invokeOnInitialized()
2024-02-02 17:24:41.886 14562-16186 ViewRootIm...nActivity] com.my-package                D  windowFocusChanged hasFocus=false inTouchMode=true
2024-02-02 17:24:41.886 14562-16188 ViewRootIm...nActivity] com.my-package                D  windowFocusChanged hasFocus=true inTouchMode=true
---------------------------- PROCESS STARTED (16211) for package com.my-package ----------------------------
2024-02-02 17:24:41.886 14562-14562 CameraSession           com.my-package                I  Closing CameraSession...
2024-02-02 17:24:41.886 14562-14562 CameraSession           com.my-package                I  Destroying session..
2024-02-02 17:24:41.901 16193-16193 DEBUG                   crash_dump64                         A  pid: 14562, tid: 16179, name: pool-11-thread-  >>> com.my-package <<<
2024-02-02 17:24:42.015 14562-14562 SurfaceOutput           com.my-package                I  Closing BarcodeScanner..
2024-02-02 17:24:42.016 14562-14562 CameraSession           com.my-package                I  CameraSession closed!
2024-02-02 17:24:42.017 14562-16059 CameraDevices           com.my-package                I  Camera #0 is now available.
2024-02-02 17:24:42.027 14562-14562 OnePlusJankManager      com.my-package                D   Chor uploadMDM JANK_TYPE_ONCE mViewTitle = com.my-package/com.my-package.MainActivity--- jank level = 2
2024-02-02 17:24:42.032 16193-16193 DEBUG                   crash_dump64                         A        #35 pc 0000000000148082  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.android.gms.internal.mlkit_vision_barcode.zza.zzb+14)
2024-02-02 17:24:42.032 16193-16193 DEBUG                   crash_dump64                         A        #38 pc 0000000000169fce  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.android.gms.internal.mlkit_vision_barcode.zzvt.zzd+22)
2024-02-02 17:24:42.032 16193-16193 DEBUG                   crash_dump64                         A        #41 pc 000000000023ff72  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.vision.barcode.internal.zzn.zza+206)
2024-02-02 17:24:42.032 16193-16193 DEBUG                   crash_dump64                         A        #44 pc 000000000023f300  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.vision.barcode.internal.zzk.zze+24)
2024-02-02 17:24:42.032 16193-16193 DEBUG                   crash_dump64                         A        #47 pc 000000000023f2cc  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.vision.barcode.internal.zzk.run+4)
2024-02-02 17:24:42.032 16193-16193 DEBUG                   crash_dump64                         A        #50 pc 0000000000242946  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.vision.common.internal.MobileVisionBase.zza+22)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #53 pc 0000000000242e3c  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.vision.common.internal.zza.call+8)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #56 pc 00000000002387e2  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.ModelResource.zza+74)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #59 pc 000000000023d33c  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.zzn.run+20)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #62 pc 000000000023d50c  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.zzt.run+20)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #65 pc 000000000023851a  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze+26)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #68 pc 00000000002384bc  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc+16)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #71 pc 000000000023d224  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.zzk.run+4)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #80 pc 00000000002384e8  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd+20)
2024-02-02 17:24:42.033 16193-16193 DEBUG                   crash_dump64                         A        #83 pc 000000000023d1a8  [anon:dalvik-classes16.dex extracted in memory from /data/app/com.my-package-Agj926jcIEhJV3r0TiJjEg==/base.apk!classes16.dex] (com.google.mlkit.common.sdkinternal.zzi.run+4)
2024-02-02 17:24:42.035  3935-3935  GoogleInpu...hodService com...gle.android.inputmethod.latin  I  GoogleInputMethodService.onStartInput():1894 onStartInput(EditorInfo{EditorInfo{packageName=com.my-package, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=-1, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
2024-02-02 17:24:42.330  1615-16233 ActivityTaskManager     system_server                        W    Force finishing activity com.my-package/.MainActivity
2024-02-02 17:24:42.333  1615-16234 FrameworkEventCollector system_server                        D  recordAppIssue PN: com.my-package
2024-02-02 17:24:42.356 14562-16188 ViewRootIm...nActivity] com.my-package                D  windowFocusChanged hasFocus=false inTouchMode=true
2024-02-02 17:24:42.365  1615-1778  ActivityManager         system_server                        I  Showing crash dialog for package com.my-package u0
2024-02-02 17:24:42.487  1615-2524  InputDispatcher         system_server                        W  channel '4f3d0f com.my-package/com.my-package.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
---------------------------- PROCESS ENDED (14562) for package com.my-package ----------------------------

Vision Camera : 3.8.2 React native : 0.73.3

thib-info commented 7 months ago

Hello there ! I'm also using the package for my RN app, and I'm facing the same issue on my Android when trying to scan a QR code. On IOS, everything works as expected, but on Android the app crashes sadly.

It looks like the issue is more complicated than expected... @oscar-b the commit you've mentioned (https://github.com/mrousavy/react-native-vision-camera/pull/2494), is it almost finished or not at all ?

In the documentation, the usage of MLKit is also mentioned but not really how to install it. I've read the official documentation of Google, but just to make sure I'm not missing a dependencies or something else, I'm asking you if it could come from there ?

Thank you for your time all !

mrousavy commented 7 months ago

Just released VisionCamera 3.9.0-beta.1, which includes the big PersistentCaptureSession PR that aims to fix all the blackscreen issues.... :eyes::tada:

You can try that new beta out yourself and let me know if you still encounter blackscreen issues. I'll continue to test on more devices in the meantime, organize the code a bit better, and then I'll tackle the preview stretching, focus, and flash issues!

If that fixes the blackscreen issues for you, please consider sponsoring me on GitHub to say thanks! ❤️