Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK 30 file issue - not showing #1

Open
WenLonG12345 opened this issue Jan 25, 2021 · 10 comments
Open

SDK 30 file issue - not showing #1

WenLonG12345 opened this issue Jan 25, 2021 · 10 comments
Labels
Android 11 support for Android 11 Scoped Storage needed enhancement New feature or request

Comments

@WenLonG12345
Copy link

WenLonG12345 commented Jan 25, 2021

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 WenLonG12345 changed the title SDK 30 file issue SDK 30 file issue - not showing Jan 25, 2021
@abhishekti7
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

abhishekti7 commented Jan 25, 2021

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
Copy link
Owner

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 abhishekti7 added enhancement New feature or request help wanted Extra attention is needed Android 11 support for Android 11 Scoped Storage needed and removed help wanted Extra attention is needed labels Jan 25, 2021
@WenLonG12345
Copy link
Author

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
Copy link

andrewindayang commented Mar 5, 2021

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

@ParthJadav
Copy link

ParthJadav commented Mar 30, 2021

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

@MKickelberg
Copy link

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
Copy link
Author

@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
Copy link

TusharGabani25890 commented Jan 11, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android 11 support for Android 11 Scoped Storage needed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants