react-native-documents / document-picker

Document Picker for React Native
https://react-native-documents.github.io/
MIT License
1.35k stars 441 forks source link

I can't select any file on ios device #498

Closed YunusEmreNalbant closed 7 months ago

YunusEmreNalbant commented 3 years ago

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

kurtesy commented 3 years ago

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

arunim2405 commented 3 years ago

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

YunusEmreNalbant commented 3 years ago

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

not working for me

YunusEmreNalbant commented 3 years ago

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?

vonovak commented 3 years ago

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

garrettks commented 3 years ago

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?

theartofnonso commented 2 years ago

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.

arijitgayen20 commented 2 years ago

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 .

garrettks commented 2 years ago

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.

arijitgayen20 commented 2 years ago

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.

arasovic commented 2 years ago

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.

arunim2405 commented 2 years ago

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.

carlosen14 commented 2 years ago

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

MimiLau commented 2 years ago

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

garima-sage commented 2 years ago

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

arjunteotia337 commented 2 years ago

same problem here. not working in iOS simulator

spnkr commented 2 years ago

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

BiplovQss commented 2 years ago

@spnkr not a good solution

pigpudle commented 2 years ago

I got this working on real device

MangalBeta commented 2 years ago

Same Problem , not working on Simulator ,

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

carlosen14 commented 2 years ago

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

vladimirevstratov commented 2 years ago

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

Jamisyed commented 2 years ago

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

RuFang-21 commented 2 years ago

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

Jamisyed commented 2 years ago

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 commented 2 years ago

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

minhchienwikipedia commented 1 year ago

Any update? I need to enable Rosetta because another issue so I can't disable it, any another solution?

igortice commented 1 year ago

same problem when i used ios 15, i upated to 16.2 so its worked for me: image

omuraydin24 commented 1 year ago

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

ravis-farooq commented 1 year ago

Has anyone found a solution? I can't select any documents in production.

AlaEddineBoughanmmi commented 1 year ago

facing the same issue.

saadalla commented 1 year ago

facing the same issue on simulator iPhone 14 Pro and Real Device. OS 15.7.2 I copied the photo to a new folder on my simulator and now I can select it. This is not a good workaround though. Any other viable fix ?

sneha-technodysis commented 1 year ago

Hello Everybody . I have faced an issue using react-native-document-picker to import file from local And then I can 't select file like above image

Please help me image Screenshot_80

Got solution?

atultiwaree commented 8 months ago

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.

It worked

vonovak commented 7 months ago

I'm going to close this because it seems it's related to an older version of the package. I'm fairly sure that if you use the latest, you won't have this issue.

https://react-native-documents.github.io/docs/sponsor-only/migration

yfuks commented 1 month ago

Was having the same issue In my case, the simulator was freezing when picking a file (the modal was not responding)

xcode: 16.0
mac: M1
macOS: 15.0.1
"react-native": "0.74.3",
"react-native-document-picker": "^9.3.1",

Fix that work for me:

In Xcode remove arm64 for simulator in Excluded architectures under Build Settings

In my case, the issue was not specific to this package (same issue in flutter)

Hope it help someone