[Android] Bridgeless callbacks crash after pick + null-safety in mime detection and startActivityForResult

Author: raid5Created Jul 17, 2026Updated Aug 23, 2026

Android-only. Distinct from the open iOS PRs (#2404 / #2406) — no iOS code involved.

Three issues on the New Architecture (bridgeless) Android path:

  1. Crash after a successful pick (bridgeless). After a pick, onAssetsObtained invokes the JS callback from a background ExecutorService thread. Under the New Architecture this trips a fatal CHECK in the JSI/C++ layer because callbacks must run on the JS/UI thread, so the app crashes right after selecting media.

  2. Unhandled NullPointerException from startActivityForResult. Only ActivityNotFoundException is caught (camera and library launches). The framework can also throw NullPointerException when the activity's window decor view isn't yet available, crashing the app instead of returning an error to JS.

  3. NullPointerException / unhelpful error in mime detection. getMimeType calls contentResolverMimeType.isBlank() without a null check, but ContentResolver.getType(uri) can return null. The "Unsupported file type" error also carries no context.

I have an Android-only fix ready (marshal callbacks onto the UI thread with null-guards; widen the startActivityForResult catch and tag launchFailed:; null-check the mime type and enrich the error). Happy to open the PR referencing this issue.

Source: react-native-image-picker/react-native-image-picker