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.

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
@YunusEmreNalbant Change DocumentPicker.pick to DocumentPicker.pickSingle, this will work with latest version
Facing the same issue using simulator above ios 14 and using m1 mac, working fine on simulator with ios below 13.7 @YunusEmreNalbant
@YunusEmreNalbant Change
DocumentPicker.picktoDocumentPicker.pickSingle, this will work with latest version
not working for me
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?
hello, some of the uti-related apis that the picker is using have been deprecated since ios 15 so it's possible that this is the problem. I'm currently busy with other OSS projects so I won't be looking into this any time soon, but a PR is welcome or I can be hired to do the job faster. Thank you :)
Hey y'all,
I'm not sure if this helps anyone, but running the simulator directly from Xcode solves this issue for me. If I try to run from the command line, I experience the same issues. Perhaps an issue with node?
You are unable to select those files because you did not include them in type: [DocumentPicker.types.images],
Example: If you only include videos, then images will be inactive for selection.
Hi is there any solution for iOS 15? I am using latest version but facing same issue in iOS simulator
.
Hi is there any solution for iOS 15? I am using latest version but facing same issue in iOS simulator
.
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.
Hi is there any solution for iOS 15? I am using latest version but facing same issue in iOS simulator
.
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.
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.
For anyone experiencing this, I fixed it by checking that I am running Xcode, node and npm all natively and not via rosetta. i no longer face this issue.
Only fails on iOS simulator, real devices do work!! also android emulators work!
same problem here, cannot select any files in File in iOS simulator. Any updates? Thanks
any solution to this? don't have a real device to test so stuck on this.
same problem here. not working in iOS simulator
try disabling rosetta in Xcode, relaunching Xcode, and then cleaning your project's build folder. then build the app and it should work again.
@spnkr not a good solution
I got this working on real device
Same Problem , not working on Simulator ,
Any Solution .....?????/
Test on real device
From: mangal @.> Sent: Thursday, September 1, 2022 1:38:29 AM To: rnmods/react-native-document-picker @.> Cc: CarlosVilla @.>; Comment @.> Subject: Re: [rnmods/react-native-document-picker] I can't select any file on ios device (Issue #498)
Same Problem , not working on Simulator ,
Any Solution .....?????/
— Reply to this email directly, view it on GitHubhttps://github.com/rnmods/react-native-document-picker/issues/498#issuecomment-1233812255, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACHPIOGY7FOMQ4242NE7IH3V4BFOLANCNFSM5HEZ4L7A. You are receiving this because you commented.Message ID: @.***>
Same issue on M1 and simulator 15.5, want to test also on simulator, not only physical device.
Same issue on M1 OS version 12.6 iOS version 16 Xcode version 14.0.1, but working with real device.
Same Issues on M1 OS version 12.5.1, Xcode version 13.4.1 , simulator ios15
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
You saved my day sir!
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