Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'launchImageLibrary' of undefined, js engine: v8 #1477

Closed
tamacroft opened this issue Nov 5, 2020 · 9 comments

Comments

@tamacroft
Copy link

ERROR
I have problem using this lib, how to fix it ?
Current version is 3.0.0-vnext.3

Btw I'm using RN 0.63.3 with react-native-v8

photo_2020-11-05_16-25-08

@tamacroft
Copy link
Author

solved with replace import ImagePicker from 'react-native-image-picker' to import {launchImageLibrary} from 'react-native-image-picker'

@ghost
Copy link

ghost commented Nov 5, 2020

This works for launchCamera too. Thanks.

@DNA-h
Copy link

DNA-h commented Nov 12, 2020

@tamacroft Thanks saved me some precious time. I think this should be added to documentation too, since it is very vague.

@YuKitAs
Copy link

YuKitAs commented Jan 24, 2021

solved with replace import ImagePicker from 'react-native-image-picker' to import {launchImageLibrary} from 'react-native-image-picker'

this doesn't work for me. Then I got the error Cannot read property 'launchImageLibrary' of undefined from the module:

> 28 |   NativeModules.ImagePickerManager.launchImageLibrary(
  29 |     {...DEFAULT_OPTIONS, ...options},
  30 |     callback,
  31 |   );

I'm using version 3.1.4.

@havinhthai
Copy link

solved with replace import ImagePicker from 'react-native-image-picker' to import {launchImageLibrary} from 'react-native-image-picker'

this doesn't work for me. Then I got the error Cannot read property 'launchImageLibrary' of undefined from the module:

> 28 |   NativeModules.ImagePickerManager.launchImageLibrary(
  29 |     {...DEFAULT_OPTIONS, ...options},
  30 |     callback,
  31 |   );

I'm using version 3.1.4.

Run npx pod-install in ios folder resolved the problem with me.

@yogesh-badgujar
Copy link

at the place of
import ImagePicker from 'react-native-image-picker';
replace
var ImagePicker = require('react-native-image-picker');
and run the application again

@talhabinkhalil
Copy link

talhabinkhalil commented Mar 11, 2022

I followed the following steps
1.) removed permissions from AndroidManifest.xml (which i provided earlier while watching a tutorial)
2.) instead of import ImagePicker from 'react-native-image-picker'; USE Following way to import ImagePicker const ImagePicker = require('react-native-image-picker');
it worked for me

@souhailtourjmen
Copy link

it worked for me

@Hedayet
Copy link

Hedayet commented Jun 28, 2023

In my case restarting the emulator fixed this issue -npm run android
my current understanding from this experience is that, it needs a restart after installing the package ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants