React-native-document-picker: Cannot read property 'pick' of undefined

Created on 19 Jul 2019  路  16Comments  路  Source: rnmods/react-native-document-picker

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

Most helpful comment

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

All 16 comments

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

"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

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

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?

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

thanks @Elyx0 and @sentry0

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

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

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

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

same here

same

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 .

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

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

Does anyone have solution for this please ?

I had to use this version

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

It solved my problem

Was this page helpful?
0 / 5 - 0 ratings