Better documentation - here's how you REALLY install [iOS]
See original GitHub issueThis should be added to the documentation. It’s much more clear and will save headaches in debugging issues.
-
Enable cloud capabilities If you have automatic code signing, this will be created and handled for you. It’s important to check the boxes exactly as shown in the picture.
-
Run
npm install git://github.com/Elyx0/react-native-document-picker.git#v3 --save
This installs the latest updates in the document picker. -
Run
react-native link
Links android modules, I honestly don’t think it does anything for iOS but may as well run it anyway. -
Open your project in XCode, right click on
Libraries
and clickAdd Files to "Your Project Name"
-
Add l
ibRNDocumentPicker.a
toBuild Phases -> Link Binary With Libraries
-
Now, restart your entire simulator, packager, debugger etc (quit out of running stuff and rerun it)
-
Should be done and working now.
For testing purposes, if you want to see if it is working, try the following react-native code: console.log(DocumentPicker)
try {
const res = DocumentPicker.pick({
type: [DocumentPicker.types.images],
});
console.log(
res.uri,
res.type, // mime type
res.name,
res.size
);
} catch ( err ) {
if ( DocumentPicker.isCancel(err) ) {
// User cancelled the picker, exit any dialogs or menus and move on
} else {
throw err;
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:37
- Comments:13 (1 by maintainers)
Top GitHub Comments
What finally worked for me was installing with cocoa pods and then changing my code to:
var DocumentPicker = require('react-native-document-picker');
@GrishmaM if you’re getting that error, add this to your Podfile (in the iOS folder). This should be added to your target scheme
Then, in the command prompt use the command
pod deintegrate
and after it is completed, dopod install
That should solve it!