1

enter image description hereI am currently facing issue with react native document picker in my react native app .

I attached screenshot for your referenced.

RNDocumentPicker -Native module is not available.

sonali bandal
  • 21
  • 1
  • 4

2 Answers2

1

This is because it is not linked with Native Code, add the below code and check

In project settings.gradle

include ':react-native-document-picker'
project(':react-native-document-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-document-picker/android')

In Build.gradle add

implementation project(':react-native-document-picker')

in MainApplication add

 protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new DocumentPickerPackage() // Add package 
        );
    }
Diptendu Das
  • 3,990
  • 7
  • 22
  • 38
0

You need to link react-native-document-picker to native.

  1. Stop the Metro server
  2. run react-native-document-picker
  3. run react-native run-android

That should solve the issue.

Jonas T
  • 2,989
  • 4
  • 32
  • 43