abhishekti7 / UnicornFilePicker

:eyes: A simple, documented, and contribution-friendly File Picker for Android.
Apache License 2.0
69 stars 13 forks source link

SDK 30 file issue - not showing #1

Open WenLonG12345 opened 3 years ago

WenLonG12345 commented 3 years ago

Hi, I really love your design for this file picker. However, the project that I implemented with this library cannot find document-related file such as .pdf, .doc, .xlsx, .zip , etc.

I am now using SDK 30, only image/video-related file displayed.
Do you mind to help me to check it out?

abhishekti7 commented 3 years ago

Hello @WenLonG12345 , Thanks for reporting your issue. I would be happy to help you out with this. Can you give me a little more detail about your problem? Specifically, any error logs, your initiation code, any observations, etc would really be a big help. Thanks,

WenLonG12345 commented 3 years ago

Hi, thanks for replying. I just clone your sample project, and then observe that the SDK version is 30 and run the app. There is files in .pdf, .doc and .xlsx I am here to attach some screenshot to illustrate my problem.

Screenshot_1611565513

Screenshot_1611565526

As you can see, all the pdf, doc and even xlsx is missing. I think it was because of Android 11's scoped storage.

abhishekti7 commented 3 years ago

Thanks for the screenshots @WenLonG12345 . If you have just cloned the sample project and have not made any changes, then I suggest you check the setFilters setter in the initialization.

 UnicornFilePicker.from(MainActivity.this)
                    .addConfigBuilder()
                    .selectMultipleFiles(true)
                    .showOnlyDirectory(true)
                    .setRootDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
                    .showHiddenFiles(false)
                    .setFilters(new String[]{"pdf", "png", "jpg", "jpeg"})
                    .addItemDivider(true)
                    .theme(R.style.UnicornFilePicker_Dracula)
                    .build()
                    .forResult(Constants.REQ_UNICORN_FILE);

the sample project is set to display only pdfs and images. You can omit the filters altogether and the file picker will by default show all the files in your directory. Please look into this and check if this solves your issue.

abhishekti7 commented 3 years ago

This definitely might be the problem caused by Android 11's scoped storage for which there is no support as of now. I am still working on it and I welcome any helpful PRs. I will put this on the roadmap. Thanks.

WenLonG12345 commented 3 years ago

I did try to add difference extension such as "xlsx", "docx", etc. but it is not working. Thanks for putting this issue up. and also, I have also no clue for the scoped storage. It makes the working so complicated even if I am using a default file picker. Will return back to you if I got any brilliant idea to share or any solution for this. Thank you 👍

andrewindayang commented 3 years ago

same issue here. i have tried 2 devices with 2 different android Version. SDK 30 cannot be found for file. Please release ASAP

ParthJadav commented 3 years ago

found same issue, but I also notice that the issue occurred in android 11 using SDK 30 because of scope storage

MKickelberg commented 3 years ago

This file picker is made for Android on 2021 but still it DOES NOT WORK on scoped storage! Soon every library is forced to use scoped storage. Hope you find time to work with this Mr. Wen.

WenLonG12345 commented 3 years ago

@MKickelberg I think there is no custom 3rd party file picker for scoped storage on Android 11 yet. Official documentation suggest to use System picker and you might currently use it instead of any 3rd party library

TusharGabani25890 commented 2 years ago

I can't able to see even images also in android 28 OS.