expo: ImagePicker.requestMediaLibraryPermissionsAsync doesn't ask ACCESS_MEDIA_LOCATION

Summary

I can’t get an image asset info on Android if I call ImagePicker.requestMediaLibraryPermissionsAsync to request permission.

It works fine on iOS, or I call MediaLibrary.requestPermissionsAsync to request permissions, then I can get an image asset info on Android after following the instruction for ACCESS_MEDIA_LOCATION

The error message is

Cannot access ExifInterface because of missing ACCESS_MEDIA_LOCATION permission

The problem is ImagePicker.requestMediaLibraryPermissionsAsync asks only write and read permissions but MediaLibrary.requestPermissionsAsync asks write, read, and ACCESS_MEDIA_LOCATION permissions.

Related issue: #15273

I tried to fix it but decided to close because it is more complicated than I thought. Ref: #16541

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

44

Environment

expo-env-info 1.0.2 environment info:
  System:
    OS: macOS 12.2.1
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.18.3 - ~/.nvm/versions/node/v14.18.3/bin/node
    Yarn: 1.22.17 - ~/.yarn/bin/yarn
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.3/bin/npm
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 29, 30
      Build Tools: 29.0.3, 30.0.2
      System Images: android-30 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7784292
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  npmPackages:
    babel-preset-expo: 9.0.2 => 9.0.2 
    expo: ^44.0.0 => 44.0.5 
    react: 17.0.1 => 17.0.1 
    react-dom: 17.0.1 => 17.0.1 
    react-native: 0.64.3 => 0.64.3 
  Expo Workflow: managed

Reproducible demo

I can’t provide the reproducible demo because we need EAS build to confirm this issue.

At Expo SDK 44, we can’t get an image asset info even if we call MediaLibrary.requestPermissionsAsync without EAS build.

Related issue: #15273

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

The issue is still occurring for us on Expo 46

Any updates on this? I am on version 49 and I still can’t get Lat/Lon from ImagePicker.

Have anyone found a solution for this?