react-native-image-picker / react-native-image-picker

:sunrise_over_mountains: A React Native module that allows you to use native UI to select media from the device library or directly from the camera.
MIT License
8.47k stars 2.08k forks source link

[🐛] [TypeError: null is not an object (evaluating 'nativeImagePicler.launchCamera')] #2095

Open anirudh-antino opened 1 year ago

anirudh-antino commented 1 year ago

Description

Explain the bug in as much detail as possible Simply install library using npm/yarn use import {launchCamera, launchImageLibrary} from 'react-native-image-picker'

getting error on launchCamera(); [TypeError: null is not an object (evaluating 'nativeImagePicler.launchCamera')]

getting error on launchImageLibrary(); [TypeError: null is not an object (evaluating 'nativeImagePicler.launchImageLibrary')]

Additional Information

ahmedbnr commented 1 year ago

I'm facing the same issue too, is there any fix to this?

sunilanumolu commented 1 year ago

as this package handles native modules, you need to rebuild Re-build the project, it'll solve the issue

laemm-line commented 1 year ago

Same problem here with version 5.3.1, a rebuild did not fix it. What else can be done?

k-angama commented 1 year ago

Version 5.3.1 of react-native-image-picker uses TurboModules (TurboModuleRegistry). You need to upgrade React Native to 0.68.2 or downgrade react-native-image-picker to 4.0.0

laemm-line commented 1 year ago

@k-angama Thank you! Downgrading to version 4.0.6 fixed it for me.

trungtruc91 commented 1 year ago

Version 5.3.1 of react-native-image-picker uses TurboModules (TurboModuleRegistry). You need to upgrade React Native to 0.68.2 or downgrade react-native-image-picker to 4.0.0

thanks, it work for me

ssshake commented 1 year ago

Is this just a typo? It says Picler instead of Picker.

Edit: it is a typo but it's just a variable name, so not the problem.

AxelCM commented 1 year ago

Version 5.0.2 works for me

luis931 commented 1 year ago

Thanks @AxelCM, version 5.0.2 also works for me

kaiquetausteck commented 11 months ago

A versão 5.3.1 do react-native-image-picker usa TurboModules (TurboModuleRegistry). Você precisa atualizar o React Native para 0.68.2 ou fazer downgrade do react-native-image-picker para 4.0.0

Thank you, it worked for me, I used 4.0.6, and for future people who have problems, my native React is 0.63

ocierd commented 9 months ago

For android api level 33 new behavior

I need to upgrade 2 dependencies

Check if the api level version is 33 or grater, then request

else (is lower than 33)

Stepan72 commented 8 months ago

Version 5.3.1 of react-native-image-picker uses TurboModules (TurboModuleRegistry). You need to upgrade React Native to 0.68.2 or downgrade react-native-image-picker to 4.0.0

Thanks that's work. Also I recommend to update to 4.9.0. There is no problem with building on Android https://github.com/react-native-image-picker/react-native-image-picker/pull/1955#issuecomment-1222338760

sidudiki commented 5 months ago

Updating react native to 0.68.2 didn't fix the issue.

"react-native": "0.68.2",
"react-native-image-picker": "7.0.1",
boxman0617 commented 5 months ago

Seeing this on:

"react-native": "0.74.1",
"react-native-image-picker": "7.1.2",
yaminichhabra commented 2 months ago

Thanks @AxelCM, version 5.0.2 worked for me "react-native-image-picker": "5.0.2", "react-native": "0.63.5",

samratcse18 commented 3 weeks ago

Thanks problem solve😍😍

"react-native": "0.64.0", "react-native-image-picker": "4.10.0",