expo: Expo Image Picker Android 13 Crash
Summary
I got multiple messages from users (and crash reports in Sentry) that the app is crashing when selecting a video from the Android Library. The crashes started after the users upgraded to Android 13.
Full Error:
Failure delivering result ResultInfo{who=null, request=1103701036, result=-1, data=Intent { dat=content://media/... flg=0x41 clip={image/* video/* {U(content)}} }} to activity {io.traindoo.android.stage/com.traindoo.MainActivity}: expo.modules.imagepicker.FailedToDeduceTypeException: Can not deduce type of the returned file
What platform(s) does this occur on?
Android
Environment
expo-env-info 1.0.5 environment info: System: OS: macOS 12.6 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node npm: 8.2.0 - ~/.nvm/versions/node/v16.13.0/bin/npm Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9014738 Xcode: 14.2/14C18 - /usr/bin/xcodebuild npmPackages: expo: ^47.0.6 => 47.0.8 react: 18.2.0 => 18.2.0 react-native: 0.70.6 => 0.70.6 Expo Workflow: bare
Minimal reproducible example
Unfortunately I can´t reproduce this error because I do not own an Android 13 Device.
My Picker Code:
await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Videos,
allowsEditing: true,
quality: 0,
exif: false,
});
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (4 by maintainers)
This seems to have started happening for our users after expo 49 upgrade, it seems to specifically affect Samsung users. Anyone else?
Running into similar issues, pretty sure it’s due to Android 13’s granular media permissions
https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions
I’m wondering if it’s the samme issue as this https://github.com/expo/expo/issues/24172 I think it might be, we’ll try updating to see if it fixes this issue.