Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

No way to get file path. #54

Closed
carotkut94 opened this issue Mar 7, 2020 · 10 comments
Closed

No way to get file path. #54

carotkut94 opened this issue Mar 7, 2020 · 10 comments

Comments

@carotkut94
Copy link

As in the latest build 1.3.2 , getPath is deprecated, and we now have to use getUri but, in order to get the file path from uri , none of the methods available on internet works. So whats the way to get the file path.

@Marc-Ferrer-Castillo
Copy link

This works for me:

ArrayList<MediaFile> files= data.getParcelableArrayListExtra(FilePickerActivity.MEDIA_FILES);
 files.get(0).getPath();

@carotkut94
Copy link
Author

but then getPath is deprecated in favour of gerUri thus, and on sdk 29+, getPath return null

@Marc-Ferrer-Castillo
Copy link

I am using sdk 29 and it works, have you tried:
android:requestLegacyExternalStorage="true"

@NSR88
Copy link

NSR88 commented Apr 27, 2020

I have tried that too, but its unluckily not working in Android 10, returning null for getPath().
Till Android 9 (that is, Pie), its working fine.

@tcs-developer
Copy link

i am also facing same issue. even i used your suggestion but no use.

@MahmoudMabrok
Copy link

so we should return back to geturi

@MahmoudMabrok
Copy link

i have two device with android 10
one of them i can pick a file with path {xiaomi with android one }
second one, get null {Samsung A6
}

@DkKhan786
Copy link

Same issue did you get any solution..?

@DharmeshMTechnolab
Copy link

I have same issue in Android 10 device if you have any solution please give me

@arzakmiftakhul
Copy link

I can get file using Uri on android 10 by following this answer

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants