expo: [expo-image-picker] [only android] Multiple selection does not work on SDK 49

Minimal reproducible example

https://snack.expo.dev/@brodanoel/trusting-yellow-ice-cream

Summary

Open the Snack and you’ll see that you won’t be able to do multiple selections on Android, since SDK 49.

I tested it on read device with the new UI layout, and it’s also broken (not sure why in the Snack the layout is the old one).

"expo-image-picker": "14.5.0",
"expo-image-manipulator": "11.5.0",
"expo-media-library": "~15.4.1",
"expo": "^49.0.9",

SDK 48

Screen Shot 2023-09-19 at 20 36 55

SDK 49

Screen Shot 2023-09-19 at 20 37 37

Environment

➜  no-filter-app git:(master) ✗ npx expo-env-info

  expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.6.8
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: 2022.3 AI-223.8836.35.2231.10406996
      Xcode: 14.2/14C18 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^49.0.9 => 49.0.9
      react: 18.2.0 => 18.2.0
      react-native: 0.72.4 => 0.72.4
    npmGlobalPackages:
      eas-cli: 5.2.0
      expo-cli: 6.3.10
    Expo Workflow: managed

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 24 (9 by maintainers)

Most upvoted comments

If someone still encounters this issue, I just added quality: 1 to the options object and now everything works perfectly on IOS, Android and Web 😎

const mediaTypes = ImagePicker.MediaTypeOptions.Images
const options = { mediaTypes, allowsMultipleSelection: true, base64: true, quality: 1 }
const result = await ImagePicker.launchImageLibraryAsync(options)

Wow I have been looking for a solution to this mess for way too long - and a simple quality: 1 solved the issue😃

Thank you - Here is a coffee ☕

test

If someone still encounters this issue, I just added quality: 1 to the options object and now everything works perfectly on IOS, Android and Web 😎

const mediaTypes = ImagePicker.MediaTypeOptions.Images
const options = { mediaTypes, allowsMultipleSelection: true, base64: true, quality: 1 }
const result = await ImagePicker.launchImageLibraryAsync(options)

Thank you so much 💕 Stay blessed

On Fri, Dec 1, 2023, 7:54 AM henZ_XD @.***> wrote:

Hello, I think my solution to this problem that also happened to me would be to use the expo library ‘expo-media-library’ and create our own screen where we will show all the images of the device with ‘flash-list’ (for a better optimization) and where the user could select the images they want, the advantage of this method is that we can program how we want the screen and what maximum number of images the user can select, fully configurable, here are the library pages:

https://docs.expo.dev/versions/latest/sdk/media-library/ https://shopify.github.io/flash-list/

The final result would be like the screen for creating a new Instagram post where it allows you to select images and like the one on Pinterest: capture_instagram.jpeg (view on web) https://github.com/expo/expo/assets/72719294/c0945509-2c31-475d-b350-73151e7f9691

A pleasure and I hope I have helped 😃

— Reply to this email directly, view it on GitHub https://github.com/expo/expo/issues/24526#issuecomment-1835373482, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYITNPCULAGGKM3GMET66QLYHFBHRAVCNFSM6AAAAAA47BGG5SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZVGM3TGNBYGI . You are receiving this because you commented.Message ID: @.***>

No, we don’t control that UI at all. It’s provided by google, we pass it whatever configuration the user provides and present it. After that, they decide how to deal with it based on OS versions, services availability etc. No problem 👍

On a device that doesn’t support google play services ie. Huawei it is the legacy behaviour that google provide, which is single selection. Android users will know because it’s not unusual for their to be differences on that platform. Either way, we can’t account for those variances. Android is open source. Manufacturers change it how they see fit.

@alanjhughes what is the expected behavior in Android 9?

This is how it’s working (multiple selection is not working):

https://github.com/expo/expo/assets/1837969/501d78e4-6b6d-4594-a3e1-1a91e5350728

This is from your snack. It works fine. You need to hold the image to select it

Screenshot 2023-09-21 at 21 50 10