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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Crash occurring during native module initialisation while opening app #3344

Open
3 of 5 tasks
FarzanAkhtar opened this issue Dec 30, 2024 · 2 comments
Open
3 of 5 tasks
Labels
🐛 bug Something isn't working

Comments

@FarzanAkhtar
Copy link

What's happening?

The app is crashing on some of our devices as soon as it opens even when not in the flow which requires Camera component.
Occurring at androidx.concurrent.futures.b$b
The completer object was garbage collected - this future would otherwise never complete. The tag was: Initialize extensions
As far as I can tell this looks to be happening from when we create an ExtensionsManger object via ExtensionsManager.getInstanceAsync(context, provider).await(mainExecutor), somehow the completer object provided to the future is getting garbage collected, so we will need to handle this edge case scenario.

Note: was not able to replicate this locally, getting crashes on production app, so putting in sample value for Camera Device field

Reproduceable Code

<Camera
  ref={cameraRef}
  format={selectedFormat?.current}
  isActive={true}
  photo={true}
  style={styles.container}
  device={device}
  video={false}
  onError={onCameraError}
  onOutputOrientationChanged={onOrientationChange}
  photoQualityBalance="speed"
/>

Relevant log output

Fatal Exception: androidx.concurrent.futures.b$b: The completer object was garbage collected - this future would otherwise never complete. The tag was: Initialize extensions
CameraManagerGlobal:
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:350)
       at android.os.Looper.loopOnce(Looper.java:187)
       at android.os.Looper.loop(Looper.java:368)
       at android.os.HandlerThread.run(HandlerThread.java:67)
mrousavy/VisionCamera.video:
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:350)
       at android.os.Looper.loopOnce(Looper.java:187)
       at android.os.Looper.loop(Looper.java:368)
       at android.os.HandlerThread.run(HandlerThread.java:67)
CameraX-scheduler:
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:350)
       at android.os.Looper.loopOnce(Looper.java:187)
       at android.os.Looper.loop(Looper.java:368)
       at android.os.HandlerThread.run(HandlerThread.java:67)

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-left",
  "hardwareLevel": "limited",
  "maxZoom": 6,
  "minZoom": 1,
  "maxExposure": 4,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "minFocusDistance": 0,
  "minExposure": -4,
  "name": "0 (BACK) androidx.camera.camera2",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"
}

Device

Realme RMX3998 (Android 14), Realme 12 5G (Android 14)

VisionCamera Version

4.5.1

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

@FarzanAkhtar FarzanAkhtar added the 🐛 bug Something isn't working label Dec 30, 2024
Copy link

Guten Tag, Hans here! 🍻

Thank you for providing detailed information about ze crash you're experiencing. It seems like a complex issue, especially since you cannot replicate it locally. To help mrousavy get a clearer picture, could you please provide logs from adb logcat when ze crash occurs?

This would really help isolate ze problem. If you need assistance with gathering logs, just let me know! And remember, sponsoring the project helps ze maintainers give priority to issues like yours. You can do it here.

Looking forward to your response!

Note: If you think I made a mistake, please ping @mrousavy to take a look.

@FarzanAkhtar
Copy link
Author

Don't have adb logcat logs as crashes are occurring for production users and we were unable to replicate this locally.

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

1 participant