Expo MediaLibrary.getAssetsAsync() crashes the app on android

Viewed 975

I'm using expo managed flow to develop my app and I'm trying to use camera roll in order to show some images.

I'm using expo's MediaLibrary and once I grant access to the camera roll via MediaLibrary.getPermissionsAsync() then, I try to call MediaLibrary.getAssetsAsync() but my android crashes. Everything works on IOS.

Note: when I add MediaLibrary.getAssetsAsync({ after: "" }) it does not crash but I've got an error where it says that "after key should be valid ID"...

Anyone knows what's the issue here?

1 Answers

I had the same inssue, I solved by doing this:

=>Run expo upgrade in your project directory (requires the latest version of expo-cli, you can update with npm i -g expo-cli).

They corrected in Expo SDK 39~40, mine was 38

Related