react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

🐛 App crash Xiaomi - POCO X3

Open ReactNativ opened this issue 1 year ago • 4 comments

What's happening?

When the camera is opened, the app crashes

it is working fine on version 3.5.1 but as you know this version have some issues

Reproduceable Code

<Camera
style={StyleSheet.absoluteFillObject}
ref={cameraRef}
device={device}
isActive={isCameraActive}
onInitialized={() => {}}
photo={true}
orientation={'portrait'}
onError={error => logToSentry(error, true, 'Camera runtime error in capture mode')}
enableHighQualityPhotos={true}
/>

Relevant log output

{
	  "name": "unknown/unknown",
	  "_code": "unknown/unknown",
	  "_message": "[unknown/unknown] supportsCameraApi:2665: Unknown camera ID 0",
	  "_cause": {
		"cause": {
		  "stacktrace": "android.os.ServiceSpecificException: supportsCameraApi:2665: Unknown camera ID 0 (code 3)\n\tat android.os.Parcel.createExceptionOrNull(Parcel.java:2390)\n\tat android.os.Parcel.createException(Parcel.java:2360)\n\tat android.os.Parcel.readException(Parcel.java:2343)\n\tat android.os.Parcel.readException(Parcel.java:2285)\n\tat android.hardware.ICameraService$Stub$Proxy.supportsCameraApi(ICameraService.java:906)\n\tat android.hardware.camera2.CameraManager.supportsCameraApiLocked(CameraManager.java:1142)\n\tat android.hardware.camera2.CameraManager.supportsCamera2ApiLocked(CameraManager.java:1118)\n\tat android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:436)\n\tat com.mrousavy.camera.core.CameraSession.configureOutputs(CameraSession.kt:250)\n\tat com.mrousavy.camera.core.CameraSession.configure(CameraSession.kt:136)\n\tat com.mrousavy.camera.core.CameraSession$createPreviewOutput$1.invokeSuspend(CameraSession.kt:204)\n\tat kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\n\tat kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)\n\tat android.os.Handler.handleCallback(Handler.java:938)\n\tat android.os.Handler.dispatchMessage(Handler.java:99)\n\tat android.os.Looper.loop(Looper.java:236)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\n",
		  "message": "supportsCameraApi:2665: Unknown camera ID 0"
		},
		"stacktrace": "java.lang.IllegalArgumentException: supportsCameraApi:2665: Unknown camera ID 0\n\tat android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1089)\n\tat android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:495)\n\tat com.mrousavy.camera.core.CameraSession.configureOutputs(CameraSession.kt:250)\n\tat com.mrousavy.camera.core.CameraSession.configure(CameraSession.kt:136)\n\tat com.mrousavy.camera.core.CameraSession$createPreviewOutput$1.invokeSuspend(CameraSession.kt:204)\n\tat kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\n\tat kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)\n\tat android.os.Handler.handleCallback(Handler.java:938)\n\tat android.os.Handler.dispatchMessage(Handler.java:99)\n\tat android.os.Looper.loop(Looper.java:236)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\nCaused by: android.os.ServiceSpecificException: supportsCameraApi:2665: Unknown camera ID 0 (code 3)\n\tat android.os.Parcel.createExceptionOrNull(Parcel.java:2390)\n\tat android.os.Parcel.createException(Parcel.java:2360)\n\tat android.os.Parcel.readException(Parcel.java:2343)\n\tat android.os.Parcel.readException(Parcel.java:2285)\n\tat android.hardware.ICameraService$Stub$Proxy.supportsCameraApi(ICameraService.java:906)\n\tat android.hardware.camera2.CameraManager.supportsCameraApiLocked(CameraManager.java:1142)\n\tat android.hardware.camera2.CameraManager.supportsCamera2ApiLocked(CameraManager.java:1118)\n\tat android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:436)\n\t... 9 more\n",
		"message": "supportsCameraApi:2665: Unknown camera ID 0"
	  }
	}

Camera Device

{}

Device

Xiaomi - POCO X3

VisionCamera Version

3.6.6

Can you reproduce this issue in the VisionCamera Example app?

Yes, I can reproduce the same issue in the Example app here

Additional information

ReactNativ avatar Nov 25 '23 11:11 ReactNativ

i have this problem too

bahador14 avatar Nov 25 '23 12:11 bahador14

I have the same issue

Kavosh-m avatar Nov 25 '23 12:11 Kavosh-m

Same case for the version 3.6.14, worklets-core: 0.2.4, and react native to 0.72.7 on this devices:

  • Samsung Galaxy A71
  • Xiaomi Poco X3 NFC

The logs are:

Crashed: Thread: SIGSEGV 0x00000073588b4430

  • 00 pc 0x5d430 libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)
  • 01 pc 0xe8238 libc++_shared.so (BuildId: fcc246cbb373c5edee634b117c4b4564cc9becf3)
  • 02 pc 0xe7e6c libc++_shared.so (BuildId: fcc246cbb373c5edee634b117c4b4564cc9becf3)
  • 03 pc 0xe3f50 libc++_shared.so (BuildId: fcc246cbb373c5edee634b117c4b4564cc9becf3)
  • 04 pc 0xe3da4 libc++_shared.so (BuildId: fcc246cbb373c5edee634b117c4b4564cc9becf3)
  • 05 pc 0x482ec libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)
  • 06 pc 0x487f4 libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)
  • 07 pc 0x3fd64 libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)
  • 08 pc 0x3c1b4 libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)
  • 09 pc 0x3bf88 libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)
  • 10 pc 0x41094 libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)
  • 11 pc 0x39f70 libVisionCamera.so (BuildId: 0297815e9897f58169c69de9d43c84c9df99d8d8)

cseluzha avatar Dec 12 '23 00:12 cseluzha