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

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

Closed
aasalshehhi opened this issue Oct 21, 2019 · 35 comments

Comments

@aasalshehhi
Copy link

aasalshehhi commented Oct 21, 2019

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
Copy link
Collaborator

Elyx0 commented Oct 21, 2019

If that's all you have after a week I don't believe you 😁

@aasalshehhi
Copy link
Author

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.

@DanielBoening
Copy link

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

@stefanoTron
Copy link

stefanoTron commented Nov 5, 2019

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

@themanpur
Copy link

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

@stefanoTron
Copy link

@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

@abhinavkhajuria
Copy link

abhinavkhajuria commented Jan 14, 2020

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"

@Elyx0 Elyx0 closed this as completed Jan 15, 2020
@Sayyamabbasi786
Copy link

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 ???

@munibkhalidhere
Copy link

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

@fahimk
Copy link

fahimk commented Jul 27, 2020

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

@sindu12jun
Copy link

This only happen in develop mode, not in production

@mrlego
Copy link

mrlego commented Sep 6, 2020

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

@sathwik77
Copy link

sathwik77 commented Sep 11, 2020

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

@yamila-fraiman
Copy link

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

@diptendulkar
Copy link

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

@GabrielDvt
Copy link

Facing the same problem. Any help?

@Siddharth2212
Copy link

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

@codeguyluke
Copy link

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.

@azouaoui-med
Copy link

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

@dsaha1656
Copy link

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

worked for me. thanks.

@jdempcy
Copy link

jdempcy commented Sep 28, 2021

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

@jdempcy
Copy link

jdempcy commented Sep 28, 2021

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

@OziTFA
Copy link

OziTFA commented Oct 13, 2021

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

@jdempcy
Copy link

jdempcy commented Oct 13, 2021

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.)

@OziTFA
Copy link

OziTFA commented Oct 13, 2021

Actually it is okay now. It was because of other lib conflict etc 👍🏻

@fribeiropaiva
Copy link

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

@CliffBrewerVEC
Copy link

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.

@ZainHasan97-Razi
Copy link

cd android && ./gradlew clean will help.

@arungogosoon
Copy link

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

@Nima-net
Copy link

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

worked for me too thanks

@winrid
Copy link

winrid commented Aug 25, 2022

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.

@remi-p-opka
Copy link

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

@hsnMoghadasi
Copy link

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

@hsnMoghadasi
Copy link

hsnMoghadasi commented Jan 8, 2023

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);


@olawalejuwonm
Copy link

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

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