react-native-image-picker: [πŸ›] [TypeError: null is not an object (evaluating 'nativeImagePicler.launchCamera')]

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

  • Image Picker version: 5.1.0
  • React Native version: 0.64.2
  • Platform: Android
  • Development Operating System: MacOS
  • Dev tools: Android Studio

About this issue

Most upvoted comments

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

Version 5.0.2 works for me

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

For android api level 33 new behavior

I need to upgrade 2 dependencies

  • React native: 0.63.2
  • upgraded to react-native-image-picker : 4.10.3
  • upgraded to react-native-permissions: 3.7.3

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

  • PERMISSIONS.ANDROID.READ_MEDIA_IMAGES
  • PERMISSIONS.ANDROID.READ_MEDIA_VIDEO
  • PERMISSIONS.ANDROID.CAMERA

else (is lower than 33)

  • PERMISSIONS.ANDROID.READ_EXTERNAL_STORAGE
  • PERMISSIONS.ANDROID.CAMERA

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.