ImagePicker.launchCameraAsync Crashing app on Android

Expo SDK: 38
Development OS: MacOS

Devices reporting the issue:
Device: Google Pixel 3a, Android version (SDK): Android 11 (SDK 30)
Device: Google Pixel 5, Android version (SDK): Android 11 (SDK 30)
Device: Samsung Galaxy S10+, Android version (SDK): Android 10 (SDK 29)
Device: Samsung Galaxy Note10+, Android version (SDK): Android 10 (SDK 29)

ImagePicker.launchCameraAsync is causing the app to crash on Android 10 devices. Works fine on iOS and the Android 11 I tested it on in development. Also it crashes without any errors logged, even wrapping it with a trycatch block gets me nothing.

Anyone got any clue what’s up or where I should look?

1 Like

Here is the SO question.

Also the Expo SDK is 39*.

Back with more updates in case anyone else is dealing with this:

The issue is discussed on github ImagePicker Crashing with Expo 37.0.0 Android 8.1 · Issue #7946 · expo/expo · GitHub.

It appears that the following note in the expo docs refers to the issue:

Note: Make sure that you handle MainActivity destruction on Android. See ImagePicker.getPendingResultAsync.

However, the docs seem to be describing handling a crash occuring after taking a picture. The crashing described in the question occurs immediately upon calling imagePicker’s camera method.

So from what I can tell, it does not appear possible to prevent the crash from actually happening.

I am having the same problem.

Expo SDK: 40
Device: Motorola g7 plus: Android 10

1 Like

https://github.com/expo/expo/issues/11465

Here’s an Issue I opened for the topic.

Still having the same issue, even in SDK 43, except now the app doesnt crash, it just never launches the camera.