UnicornFilePicker icon indicating copy to clipboard operation
UnicornFilePicker copied to clipboard

SDK 30 file issue - not showing

Open WenLonG12345 opened this issue 3 years ago • 10 comments

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?

WenLonG12345 avatar Jan 25 '21 06:01 WenLonG12345

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,

abhishekti7 avatar Jan 25 '21 08:01 abhishekti7

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.

WenLonG12345 avatar Jan 25 '21 09:01 WenLonG12345

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 avatar Jan 25 '21 09:01 abhishekti7

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.

abhishekti7 avatar Jan 25 '21 09:01 abhishekti7

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 👍

WenLonG12345 avatar Jan 25 '21 10:01 WenLonG12345

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

andrewindayang avatar Mar 05 '21 18:03 andrewindayang

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

ParthJadav avatar Mar 30 '21 05:03 ParthJadav

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.

MKickelberg avatar Apr 04 '21 22:04 MKickelberg

@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

WenLonG12345 avatar Apr 05 '21 01:04 WenLonG12345

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

TusharGabani25890 avatar Jan 11 '22 07:01 TusharGabani25890