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.

launchImageLibrary not working on iPhone emulator

See original GitHub issue

react-native-cli: 2.0.1 react-native: 0.40.0 “react-native-image-picker”: “^0.25.1”,

It works fine on Android, but when I run it in the iOS emulator or physical iphone device I get this error:

undefined is not a function (evaluating ‘_reactNativeImagePicker2.default.launchImageLibrary(options, function(response){ })’)

Here is the stripped down version of my source code:

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

class EditListing extends Component {
    pickImage(imageType){
	let options = {
		mediaType: 'photo',
		quality: 1,
		maxWidth: 144,
		maxHeight: 144
	}

	ImagePicker.launchImageLibrary(options, (response) => {
		...
	});
    }
   ...
}

The only thing different I can think of is that when I linked the binary with the library, I could only find “libRNImagePicker.a” (instead of “RNImagePicker.a” like the documentation states.)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10

github_iconTop GitHub Comments

4reactions
PuppyYuancommented, Jan 12, 2017

install it manually, do not use auto link command line

2reactions
anthonytietjencommented, May 16, 2017

No problem @cosydney. In the readme file, refer to the manual iOS installation instructions. It talks about manually linking up libraries in your Xcode project. I undid all of that and then walked through the steps again and it worked that time. I must have just done it wrong the first time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

launchImageLibrary not working on iPhone emulator #449
I am using react-native-firebase-starter and I added react-native-image-picker, it did not work, however when I did it manually according to the ...
Read more >
Xcode Simulator m1 - can't pick im… | Apple Developer Forums
Hi, can anybody confirm that there are a problem with the image picker on Xcode 12.4 / Sim 12.4 on the new apple...
Read more >
Image Picker not working in React Native app, why?
Updated with new input: your ImagePicker object do not have launchImageLibrary nor launchCamera . There is a problem with you installation .
Read more >
Running On Simulator - React Native
Once you have your React Native project initialized, you can run npx react-native run-ios inside the newly created project directory. If ...
Read more >
react-native-image-picker - npm
A React Native module that allows you to use native UI to select media from the device library or directly from the camera....
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