react-native-document-picker: I can't select any file on ios device

I can’t select any file on ios device. Not so on Android device. How can I solve this problem? As you can see in the screenshot it doesn’t let me select any file. Ekran Resmi 2021-11-01 23 01 12

my code:


const  openDocumentPicker = async ()=>{
        // Pick a single file
        try {
            const res = await DocumentPicker.pick({
                type: [DocumentPicker.types.allFiles],
            });
            console.log('output' + JSON.stringify(res));
        } catch (err) {
            if (DocumentPicker.isCancel(err)) {
                // User cancelled the picker, exit any dialogs or menus and move on
            } else {
                throw err
            }
        }
    }

npx react-native info System: OS: macOS 11.6 CPU: (8) arm64 Apple M1 Memory: 117.80 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.0.1 - /opt/homebrew/bin/node Yarn: Not Found npm: 8.1.0 - /opt/homebrew/bin/npm Watchman: 2021.10.18.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0 Android SDK: API Levels: 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.2 System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs ARM 64 v8a, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: Not Found Xcode: 13.0/13A233 - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 14
  • Comments: 34 (1 by maintainers)

Most upvoted comments

Facing the same issue using simulator above ios 14 and using m1 mac, working fine on simulator with ios below 13.7 @YunusEmreNalbant

Hi is there any solution for iOS 15? I am using latest version but facing same issue in iOS simulator Screenshot 2021-12-15 at 10 59 27 AM .

I am not sure if this helps or not, but this is only an issue in the simulator. When I install my app on a phone running iOS 15, it works perfectly fine.

Close the XCODE Go to the application Get info XCODE Untick “Open Using Rosetta” Open Project Clean Project Build Again is a fix for me

I got this working on real device

I’m using m1 mac. My simulator was IOS 15+ , It was same, I could not select anything. I downgraded IOS 13.4 my simulator and everything is running via rossetta ( yarn, Xcode, simulator) It is working now. It’s look like there is problem on IOS 15 Simulator or something like that, idk

But I’m really curious about this issue and I will follow.

In the @garrettks 's and @arijitgayen20 's comments, it was mentioned that it works on real devices. I don’t have a chance to try right now. For workaround and testing, it looks like it’s necessary to use the simulator IOS 13.

try to hold your mouse click until opening the little options popup, then it wont be grayed out, select the file again.

try disabling rosetta in Xcode, relaunching Xcode, and then cleaning your project’s build folder. then build the app and it should work again.

Hi is there any solution for iOS 15? I am using latest version but facing same issue in iOS simulator Screenshot 2021-12-15 at 10 59 27 AM .

I am not sure if this helps or not, but this is only an issue in the simulator. When I install my app on a phone running iOS 15, it works perfectly fine.

Thanks for the info @garrettks . Yes i checked its working fine on real device.

Facing the same issue using simulator above ios 14 and using m1 mac, working fine on simulator with ios below 13.7 @YunusEmreNalbant

yes, it works on ios version 13.4. Is this problem caused by m1 or is it caused by the ios version?