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

Cannot read property 'pick' of undefined #221

Closed
kunalverma94 opened this issue Jul 19, 2019 · 24 comments
Closed

Cannot read property 'pick' of undefined #221

kunalverma94 opened this issue Jul 19, 2019 · 24 comments

Comments

@kunalverma94
Copy link

kunalverma94 commented Jul 19, 2019

..installation must be made easy.+followed allsteps still getting the error
Cannot read property 'pick' of undefined
FYI i followed all you instructions

@Elyx0
Copy link
Collaborator

Elyx0 commented Jul 19, 2019

What version of react native & on ios or android ? Which version? Plugin version?

@kunalverma94
Copy link
Author

kunalverma94 commented Jul 20, 2019

"react-native-document-picker": "^3.2.2",

react-native-cli: 2.0.1
react-native: 0.60.3

win 10 ..
running app n redmi note 3

@kunalverma94
Copy link
Author

kunalverma94 commented Jul 20, 2019

if i follow these steps https://www.npmjs.com/package/react-native-document-picker#android get error
--error in getPackages


@OverRide
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new DocumentPickerPackage() // Add package
);
}
on adding this
android - cannot find symbol MainReactPackage
set canOverrideExistingModule=true in React Native error with red screen

@Elyx0
Copy link
Collaborator

Elyx0 commented Jul 20, 2019

Does it change something if you do

// file: MainApplication.java
...

import com.reactnativedocumentpicker.ReactNativeDocumentPicker; // <-- this line for import package

public class MainApplication extends Application implements ReactApplication {

If it doesn't can you try this version https://github.com/Elyx0/react-native-document-picker/tree/v2 (doc changed)
by using "react-native-document-picker": "~2.3.0" ( npm install [email protected] ) and see if it bugs?

@sentry0
Copy link

sentry0 commented Jul 22, 2019

I was having the same issue after upgrading and for me it was a simple import change that did the trick...

I went from:
import { DocumentPicker } from 'react-native-document-picker'

To:
import DocumentPicker from 'react-native-document-picker'

No more brackets :P

@kunalverma94
Copy link
Author

thanks @Elyx0 and @sentry0

@MarlonX19
Copy link

I am having the same issue stated above. No matter what I do it keeps happening every single time I try to run the app to test:

@OverRide
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new DocumentPickerPackage() // Add package
);
}
on adding this
android - cannot find symbol MainReactPackage

@Shahrukh0396
Copy link

i am facing the same issue on ios
react-native: 0.61.5
ios :9.0

@ghafartanveer
Copy link

ghafartanveer commented Mar 6, 2020

i'm facing the same issue. Can anyone guide me how to resolve this issue?

@Zakyyy
Copy link

Zakyyy commented May 30, 2020

@ghafartanveer make sure that after installing the package you restarted the app again and closed the initiated Metro builder

@kostiantyn-solianyk
Copy link

same here

@Samtapes
Copy link

same

@PrasadGhan
Copy link

I Was having same issue i just do npx react-native unlink and then re-link again after linking if package entry is not present in app/build.gradle then You need to add manually
This working for me .

@Pragnesh-Dharajiya
Copy link

i'm facing the same issue on IOS. Can anyone guide me how to resolve this issue?

@prabhario
Copy link

I'm facing this issue "TypeError: Cannot read property 'pick' of undefined" in react native windows application

Does anyone have solution for this please ?

@fernandokbs
Copy link

I had to use this version

"react-native-document-picker": "^4.1.0",

It solved my problem

@Ravi-Pal
Copy link

Ravi-Pal commented Oct 5, 2021

I am facing same issue ,using "react-native-document-picker": "^6.1.1"

Please help me
Document Picker Error

@AdithyaBellamkonda
Copy link

@prabhario did you resolve that issue because I'm having same issue, and I'm using windows application

@lukabanjac
Copy link

Run pod install and rebuild an app if you haven't already. It's in the docs and I missed it. Fixed for me after I did it.

@Vashu473
Copy link

Restart your bundler it will help you.

@flatingofamily
Copy link

the same problem guys :(

@MacKenzieHnC
Copy link
Contributor

Anybody got a repro?

@ChronoByteCosmonaut
Copy link

ChronoByteCosmonaut commented Mar 31, 2023

Same issue, using the expo managed workflow. "Possible Unhandled Promise Rejection : TypeError: Cannot read property 'pick' of null. And i am using pickSingle.

@navtesh21
Copy link

does anyone has altenative to react native document picker because this one is getting this error TypeError: Cannot read property 'pick' of null

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