question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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

  1. Install Expo in device
  2. Run demo
  3. Allow permissions
  4. 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
barthapcommented, Oct 1, 2020

Try updating androidx.exifinterface:exifinterface:1.0.0 to 1.3.0 in expo-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" in AndroidManifest.xml:

<manifest ... >
  <application android:requestLegacyExternalStorage="true" ... >
    ...
  </application>
</manifest>
0reactions
barthapcommented, Oct 14, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo MediaLibrary.getAssetsAsync() crashes the app on ...
I'm using expo's MediaLibrary and once I grant access to the camera ... getAssetsAsync() but my android crashes. ... Dec 13, 2020 at...
Read more >
MediaLibrary - Expo Documentation
expo-media-library provides access to the user's media library, allowing them to access their existing images and videos from your app, as well as...
Read more >
CHANGELOG.md Ā· ē†Šåˆš/Expo - Gitee.com
Changelog. This is the log of notable changes to the Expo client that are developer-facing. Package-specific changes not released in any SDK will...
Read more >
expo-error-recovery - NPM Package Versions - Socket.dev
Utilities for helping you gracefully handle crashes due to fatal JavaScript ... Fix Android crash caused by assertSubscriptionAlive methodĀ ...
Read more >
expo | Yarn - Package Manager
Restore location exif data getter for Android 10+ devices. (#14413 by @ajsmth); EXIF parsing failure no longer crashes the getAssetsAsync andĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found