Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Android | Crashing on getCameraSelectorLensFacing #2867

Closed
4 of 5 tasks
omerts opened this issue May 10, 2024 · 2 comments
Closed
4 of 5 tasks

馃悰 Android | Crashing on getCameraSelectorLensFacing #2867

omerts opened this issue May 10, 2024 · 2 comments
Labels
馃悰 bug Something isn't working

Comments

@omerts
Copy link

omerts commented May 10, 2024

What's happening?

From production, got an app crashed, with the following exception from crashlytics:

Fatal Exception: java.lang.IllegalArgumentException: The given lens facing integer: 255 can not be recognized.
       at androidx.camera.camera2.internal.LensFacingUtil.getCameraSelectorLensFacing(LensFacingUtil.java:56)
       at androidx.camera.camera2.internal.Camera2CameraInfoImpl.getLensFacing(Camera2CameraInfoImpl.java:203)
       at com.mrousavy.camera.core.CameraDeviceDetails.<init>(CameraDeviceDetails.kt:41)
       at com.mrousavy.camera.react.CameraDevicesManager.getDevicesJson(CameraDevicesManager.kt:86)
       at com.mrousavy.camera.react.CameraDevicesManager.sendAvailableDevicesChangedEvent(CameraDevicesManager.kt:94)
       at com.mrousavy.camera.react.CameraDevicesManager$initialize$1.invokeSuspend(CameraDevicesManager.kt:71)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:923)

Reproduceable Code

<InternalCamera
            codeScanner={codeScanner}
            enableZoomGesture={true}
            style={styles.preview}
            ref={camera}
            device={device}
            audio={false}
            torch={supportsFlash && flash ? 'on' : 'off'}
            isActive={isActive}
            photo={!onBarCodeDetected}
          />

Relevant log output

Came from crashlytics so I don't have the physical device

Camera Device

Done have the actual device in hand, this is from crashlytics:

Device
Brand:Sanmu - FIH Foxconn
Model:A13 Pro
Orientation:Portrait
RAM free: 1.07 GB
Disk free: 43.4 GB
Operating system
Version:Android 11
Orientation:Portrait
Rooted:No

Device

Sanmu - FIH Foxconn A13 Pro

VisionCamera Version

4.0.1

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

@omerts omerts added the 馃悰 bug Something isn't working label May 10, 2024
@zzz08900
Copy link
Sponsor Contributor

This is not a RNVC issue, its a misbehaving phone OS issue.
Ask the device vendor to fix their broken camera implementation.

@mrousavy
Copy link
Owner

Yep, exactly as @zzz08900 said. If they cannot implement Cameras properly on their phone, there's nothing I can do.

Also, I wouldn't really be able to help without native logs. You can also set up Crashlytics or Sentry to give you native logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants