skip to Main Content

I’m currently writing an app where users can upload images, but I want users to be able to upload multiple images.

I’ve tried using libraries like:
expo-image-picker-multiple,
expo-images-picker

but nothing seems to be working.
I would love to know which library can I use to allow users to upload when using expo [react-native]

UPDATE

expo-images-picker implementation

     <AssetsSelector
        options={{
          assetTypes: ['photo'],
          noAssetsText: "No media found",
          maxSelections: 3,
          margin: 2,
          portraitCols: 4,
          landscapeCols: 5,
          widgetWidth: 100,
          widgetBgColor: "#fff",
          selectedIcon: {
            Component: Ionicons,
            iconName: "ios-checkmark-circle-outline",
            color: "#fff",
            bg: "#000",
            size: 25
          },
          noAssets: {
            Component: () => <Text>No assets</Text>
          }
        }}
      />

returns error ‘undefined is not an object (evaluating ‘Settings.portraitCols’)

I’ve been getting this error while trying to implement expo-images-picker. How can I fix this?

Thanks,
Arnav.

2

Answers


  1. "expo-images-picker" is an updated library with full Platform Compatibility, it should work, it’s the best way for that. You may have forgotten to allow the permissions required to make it work.

    Login or Signup to reply.
  2. I have the same problem – it works fine when allowsMultipleSelection: false, but setting it to allowsMultipleSelection: true gives an error ( "code":"ERR_INVALID_MEDIA_TYPE","message":"Cannot handle 'public.jpeg' media type" for every picture I try to select)

    I left an issue here: https://github.com/expo/expo/issues/19300, I hope it gets picked up

    Context:
    React 18
    Expo SDK 46
    Expo-image-picker": “~13.3.1”,
    iOS 15.5 Iphone Simulator
    Typescript 4.8.2

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search