document-picker icon indicating copy to clipboard operation
document-picker copied to clipboard

I can't select any file on ios device

Open YunusEmreNalbant opened this issue 2 years ago • 23 comments

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

YunusEmreNalbant avatar Nov 01 '21 20:11 YunusEmreNalbant

@YunusEmreNalbant Change DocumentPicker.pick to DocumentPicker.pickSingle, this will work with latest version

kurtesy avatar Nov 07 '21 07:11 kurtesy

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

arunim2405 avatar Nov 08 '21 10:11 arunim2405

@YunusEmreNalbant Change DocumentPicker.pick to DocumentPicker.pickSingle, this will work with latest version

not working for me

YunusEmreNalbant avatar Nov 10 '21 19:11 YunusEmreNalbant

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?

YunusEmreNalbant avatar Nov 10 '21 19:11 YunusEmreNalbant

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 :)

vonovak avatar Nov 11 '21 08:11 vonovak

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?

garrettks avatar Nov 11 '21 18:11 garrettks

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.

theartofnonso avatar Nov 25 '21 21:11 theartofnonso

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 .

arijitgayen20 avatar Dec 15 '21 05:12 arijitgayen20

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.

garrettks avatar Dec 15 '21 14:12 garrettks

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.

arijitgayen20 avatar Dec 15 '21 14:12 arijitgayen20

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.

arasovic avatar Mar 21 '22 14:03 arasovic

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.

arunim2405 avatar Mar 21 '22 14:03 arunim2405

Only fails on iOS simulator, real devices do work!! also android emulators work!

carlosen14 avatar Mar 25 '22 23:03 carlosen14

same problem here, cannot select any files in File in iOS simulator. Any updates? Thanks

MimiLau avatar Apr 13 '22 15:04 MimiLau

any solution to this? don't have a real device to test so stuck on this.

garima-sage avatar Apr 26 '22 07:04 garima-sage

same problem here. not working in iOS simulator

arjunteotia337 avatar May 31 '22 12:05 arjunteotia337

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 avatar Jun 02 '22 04:06 spnkr

@spnkr not a good solution

BiplovQss avatar Jun 22 '22 08:06 BiplovQss

I got this working on real device

pigpudle avatar Jul 04 '22 09:07 pigpudle

Same Problem , not working on Simulator ,

Any Solution .....?????/

MangalBeta avatar Sep 01 '22 06:09 MangalBeta

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: @.***>

carlosen14 avatar Sep 01 '22 12:09 carlosen14

Same issue on M1 and simulator 15.5, want to test also on simulator, not only physical device.

vladimirevstratov avatar Sep 05 '22 13:09 vladimirevstratov

Same issue on M1 OS version 12.6 iOS version 16 Xcode version 14.0.1, but working with real device.

Jamisyed avatar Oct 12 '22 10:10 Jamisyed

Same Issues on M1 OS version 12.5.1, Xcode version 13.4.1 , simulator ios15

RuFang-21 avatar Oct 28 '22 05:10 RuFang-21

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

Jamisyed avatar Oct 28 '22 08:10 Jamisyed

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

wanderlust252 avatar Oct 28 '22 13:10 wanderlust252