Skip to content

TypeError: null is not an object (evaluating '_reactNative.NativeModules.ImagePickerManager.launchImageLibrary') #1621

Answered by ramijos
ramijos asked this question in Q&A
Discussion options

You must be logged in to vote

oufff!! i have finally found a solution that has worked for me:
1- Edit the gradle file : "project_name\android\build.gradle":
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
}
#to avoid error: use a compatible library with a minsdk of at most 16

2- uninstall the lastest image-picker module and install the old one:
- npm uninstall react-native-image-picker
- npm install react-native-image-picker@2.3.4 --save
- react-native link react-native-image-picker
- npx react-native start --reset-cache

3- edit permissions:
- ios: ios/project_name/Info.plist


...
NSPhotoLibraryUsageDescription
$(PRODUCT_NAME) voudrait accéder à votre g…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ramijos
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants