react-native-image-picker: Undefined is not an object (evaluating 'ImagePickerManager.showImagePicker') on iOS

following the “Manual Installation” step by step, still show this issue.(same operations in other project works fine, i don’t know why )

finally, i drag ImagePickerManager.h & ImagePickerManager.m into my project, and it works fine ! waste too much time

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 30

Most upvoted comments

This worked for me on android issue:

import * as ImagePicker from 'react-native-image-picker';

ImagePicker.showImagePicker(options, (response) => {
         // code here
};

oh , expo !!! no use yet ! i don’t like it !

For those who use Expo we can use this build-in library of EXPO https://docs.expo.io/versions/v26.0.0/sdk/imagepicker

@Daneyl Make sure you are adding the libRNImagePicker.a in the “Build Phases” at the root of your project instead of the Libraries branch. If you do that, you wont find any libRNImagePicker.a references to add. If you do this by dragging the Products > libRNImagePicker.a tree item over the list. remove it. That just wont work.

Once you did the step 3 of the README.MD follow the next steps:

1 - Select your project root 2- In the center pane of the xcode screen look for this < > buttons. 3- Open the dropdown list below them. 4- Select the item named after your project name, the one in “Targets” section of the dropdown 5- Then you should find “Build phases” tab almost all the way to the right over the same row.

image

6- Scroll down to the “Link Binary With Libraries” section. 7- Clic ‘+’ button at the bottom of the list, now you should find the libRNImagePicker.a this time.

Then compile and run the app

This worked for me. I was facing this issue, tried all the solutions I could find online just like you. luckily I read about this in one of the related issues around here (I don’t remember now), that comment wasn’t clear enough for me to understand at first, but it gave me a lead.

I think I’m a couple of months late, anyway I hope it helps you or someone else.

Problem not sorted yet. This problem only persist in iOS. have tried almost everything available on web. I have: -reinstall library -manually steps followed for iOS -deleted the app and than have installed it again -installed specific versions of this library but none of them worked Please help…

@fithaN 0.50.3 ?

i just create a new project again and following the “Manual Installation” doc. it can running up successfully !

"dependencies": {
    "react": "16.2.0",
    "react-native": "0.52.0",
    "react-native-image-picker": "^0.26.7"
  },

my steps: 1, create project with “react-native init testImagePicker” 2, cd testImagePicker && npm install react-native-image-picker@latest --save 3, add(dragging & dropping) “RNImagePicker.xcodeproj” to “testImagePicker” project’s Libraries 4, add “RNImagePicker.a” to “Build Phases” 5, setting “Info.plist” with 4 keys {NSPhotoLibraryUsageDescription, NSCameraUsageDescription, NSPhotoLibraryAddUsageDescription and NSMicrophoneUsageDescription} 6, in vscode IDE , add RN code to test 7, npm start 8, xcode command+R to RUN

image

image

image