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 https://github.com/expo/expo/issues/7946.

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

2 Likes

Here’s an Issue I opened for the topic.