[expo-media-library] Crash getAssetsAsync in Android 10
See original GitHub issueš Bug Report
Summary of Issue
getAssetsAsync will crash in android 10 (real device)
Environment - output of expo diagnostics
& the platform(s) youāre targeting
Expo CLI 3.24.2 environment info: System: OS: macOS 10.15.6 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node Yarn: 1.22.4 - ~/.nvm/versions/node/v12.18.3/bin/yarn npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.5 AI-191.8026.42.35.5791312 Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild npmPackages: react: ^16.13.1 => 16.13.1 react-native: ^0.63.3 => 0.63.3 npmGlobalPackages: expo-cli: 3.24.2
expo-media-library: 9.2.1 react-native-unimodules: 0.11.0
Reproducible Demo
https://snack.expo.io/@natysoz/sdk-39-exif-issue
Steps to Reproduce
Requirement
- Real device with android 10 (in my case SM-N976N - samsung galaxy note 10)
Steps
- Install Expo in device
- Run demo
- Allow permissions
- Press āLOAD ASSETSā button
Expected Behavior vs Actual Behavior
Expected Behavior: load assets success Actual Behavior: Error occured FROM
P.S.
#10398 was closed Because expo sdk 39 will fix issues. But bare workflow still catch error
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Try updating
androidx.exifinterface:exifinterface:1.0.0
to1.3.0
inexpo-media-library/android/build.gradle
, then rebuild project and let me know if it helped. It seems the issue may be related to some permission changes.It seems that Android 10 has some external storage permission changes and it may be also needed adding
android:requestLegacyExternalStorage="true"
inAndroidManifest.xml
:Your logs say itās SDK 37, https://github.com/expo/expo/issues/9440#issuecomment-701980999
If it still happens in SDK 39, please open a new issue.