react-native-documents/document-picker

Possible Unhandled Promise Rejection (id: 1): TypeError: null is not an object (evaluating 'RNDocumentPicker.pick')

Closed this issue ยท 35 comments

Please help me solving this error. I have been trying for a week.

Possible Unhandled Promise Rejection (id: 1): TypeError: null is not an object (evaluating 'RNDocumentPicker.pick')

This happens in IOS simulator only

Elyx0 commented

If that's all you have after a week I don't believe you ๐Ÿ˜

Well this is what is actually happening. I even deleted my project and used the backup to install again, but still the same issue in IOS.

@aasalshehhi did you upgrade to > RN.60? The new binding system could mess with you.

@aasalshehhi
had the same warning, forgot to run cd ios && pod install && cd ...
Close the app and the packager and restart.

Hello ! Please help me solving this error
[Unhandled promise rejection: TypeError: undefined is not an object (evaluating '_expoDocumentPicker.DocumentPicker.getDocumentAsync')]

@themanpur, this is not the right repo, you are using Expo's documentPicker https://docs.expo.io/versions/latest/sdk/document-picker/

maybe you can find some help here https://github.com/expo/expo/tree/master/packages/expo-document-picker

Same is still happening in case of running the app in android in debugging. whereas the app in release mode is working fine.

in "react-native-document-picker": "^3.2.4"
"react-native": "0.61.5"

I am facing the same issue even though it has been installed properly and I have updated podfile as well and then also did the pod install but still the same issue, anyone ???

having the same issue... anyone solved it yet?

This seems to happen only on the device emulators. When running on a real device it works fine.

This only happen in develop mode, not in production

i got the same error...i am really starting to dislike RN : (

Same issue with expo v38 and package v3.5.3. Can OP reopen this issue?

Same issue using android. I'm not using expo.

I am facing this issue on Android device and emulator . Anyone solved it ??

Facing the same problem. Any help?

Did anyone find solution to this? I am facing this issue as well.

In my case the issue was:
pod 'react-native-document-picker', path: '../node_modules/react-native-document-picker'
line that was not automatically added to Podfile (although React Native version we use is 0.61.2) so Pod didn't get installed.

After I have added the line manually and rerun cd ios && pod install && cd .. it worked perfectly.

i was having the same issue on android device and i resolved it by running cd android && ./gradlew clean

i was having the same issue on android device and i resolved it by running cd android && ./gradlew clean

worked for me. thanks.

I've tried everything in this thread and the issue still occurs for me on Android. This is what I get when I try to open the file picker:
image

Opening on an actual device works. Simulator always gives the above error

Got still same error even on simulator/real device.. TypeError: null is not an object (evaluating 'RNDocumentPicker.pick')

Which device are you using OziTFA? The error occurs on all emulators in my testing, but I have also tested on two devices and it does not occur on either. (A Motorola and a Huawei.)

Actually it is okay now. It was because of other lib conflict etc ๐Ÿ‘๐Ÿป

Actually it is okay now. It was because of other lib conflict etc ๐Ÿ‘๐Ÿป

Could you tell us what you did to solve it? Having the same issue here

I know I'm late to the party, but I had the same issue and managed to fix it.
I think the problem is you need to rebuild the java portion of the application and to achieve this I simply had to shut down my virtual device and restarted it with npx react-native run-android from the project folder.

cd android && ./gradlew clean will help.

Running react-native link react-native-document-picker fixed this issue for me

i was having the same issue on android device and i resolved it by running cd android && ./gradlew clean

worked for me too thanks

i was having the same issue on android device and i resolved it by running cd android && ./gradlew clean

worked for me. thanks.

Does not work with Pixel 2 emulator, including resetting Metro's cache.

Works on emulator (android) but not on real device (ios).

some time it works Properly. some time not.
what could i do?

i comment type option and its work well :/
what could i do?

import DocumentPicker, {DocumentPickerOptions, DocumentPickerResponse, types} from 'react-native-document-picker';

const option: DocumentPickerOptions<'android'> = {
  // type: [types.pdf, types.doc, types.docx, types.zip, types.images],
  allowMultiSelection: true,
  presentationStyle: 'fullScreen',
};
const response: DocumentPickerResponse[] = await DocumentPicker.pickMultiple(option);


I'm also having the same issue. Any solution?