question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better documentation - here's how you REALLY install [iOS]

See original GitHub issue

This should be added to the documentation. It’s much more clear and will save headaches in debugging issues.

  1. Enable cloud capabilities screen shot 2018-02-17 at 1 28 14 pm 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.

  2. Run npm install git://github.com/Elyx0/react-native-document-picker.git#v3 --save This installs the latest updates in the document picker.

  3. Run react-native link Links android modules, I honestly don’t think it does anything for iOS but may as well run it anyway.

  4. Open your project in XCode, right click on Libraries and click Add Files to "Your Project Name" screen shot 2018-02-17 at 1 32 19 pm screen shot 2018-02-17 at 1 30 38 pm

  5. Add libRNDocumentPicker.a to Build Phases -> Link Binary With Libraries screen shot 2018-02-17 at 1 34 06 pm

  6. Now, restart your entire simulator, packager, debugger etc (quit out of running stuff and rerun it)

  7. 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:closed
  • Created 6 years ago
  • Reactions:37
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
miajohansson9commented, Feb 10, 2019

What finally worked for me was installing with cocoa pods and then changing my code to:

var DocumentPicker = require('react-native-document-picker');

DocumentPicker.default.pick({
                            type: [DocumentPicker.default.types.allFiles],
                          },(error,res) => {
                            // Android
                            console.log(
                              "Okay Bhai error paichi Document Picker e: ",
                              res.uri,
                              res.type,
                              res.fileName,
                              res.fileSize
                            );
                          })
1reaction
agates4commented, Apr 3, 2018

@GrishmaM if you’re getting that error, add this to your Podfile (in the iOS folder). This should be added to your target scheme

target 'MyApp' do
    # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
    # use_frameworks!

    # Pods for MyApp
    rn_path = '../node_modules/react-native'
    pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
    pod 'React', path: rn_path, subspecs: [
        'Core',
        'RCTActionSheet',
        'RCTAnimation',
        'RCTGeolocation',
        'RCTImage',
        'RCTLinkingIOS',
        'RCTNetwork',
        'RCTSettings',
        'RCTText',
        'RCTVibration',
        'RCTWebSocket',
        'DevSupport'
    ]

    pod 'react-native-document-picker', :path => '../node_modules/react-native-document-picker`

end

# very important to have the below added to the very end of the Podfile
post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "React"
            target.remove_from_project
        end
    end
end

Then, in the command prompt use the command pod deintegrate and after it is completed, do pod install

That should solve it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Just Install iOS 16? Here's What to Set Up First - MacRumors
Just Install iOS 16? Here's What to Set Up First · More videos on YouTube · Set Up Your Lock Screens · Link...
Read more >
Get iOS 16: Here's how to install the beta - 9to5Mac
Make a fresh backup of your iPhone or iPad · On your iPhone or iPad, head to Apple's public beta website · Tap...
Read more >
Update your iPhone or iPad - Apple Support
Go to Settings > General > Software Update. · Tap Automatic Updates, then turn on Download iOS Updates. · Turn on Install iOS...
Read more >
Ready to Upgrade? How to Get iOS 16 - PCMag
The entire point of developers having the software is to test it out with their apps, so you might find that some of...
Read more >
The Top New Features in Apple's iOS 15 - iPhone - WIRED
Before installing iOS 15, back up your iPhone. Backing up is simple if you do it via iCloud. Head to Settings. Tap on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found