Skip to content

Conversation

@limpbrains
Copy link
Contributor

Handle camera initialization failures gracefully instead of crashing the app.

On devices or emulators without cameras, ProcessCameraProvider.getInstance().get() throws an exception that was previously uncaught, causing the app to crash. This change catches the exception and dispatches an ErrorEvent to the JS layer via the onError callback.

The error message extracts the root cause from nested exceptions for cleaner error reporting (e.g., "Device reporting less cameras than anticipated. Available cameras: 0" instead of a wrapped ExecutionException).

closes #756

How did you test this change?

  • Tested on Android emulator without camera configured - app no longer crashes, onError callback fires with descriptive message
  • Tested on Android device with camera - camera works normally

@scarlac scarlac merged commit 5a709e0 into teslamotors:master Dec 30, 2025
2 of 4 checks passed
@scarlac
Copy link
Collaborator

scarlac commented Dec 30, 2025

Thank you for your contribution, @limpbrains !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App crashes on android emulator without cameras

2 participants