jamesmontemagno / MediaPlugin

Take & Pick Photos and Video Plugin for Xamarin and Windows
MIT License
711 stars 360 forks source link

Cannot Use Album Path Content Uri After Picking Gallery Image #588

Open mpadhiar opened 6 years ago

mpadhiar commented 6 years ago

I am trying to use the Album Path returned by pick media on android. I can see that a content uri is returned but when i try to use that content uri to query file gallery path or either open input stream from that a security exception is returned. Is there a way i can consume this uri ?

Exception: opening provider com.google.android.apps.photos.contentprovider.MediaContentProvider from ProcessRecord{25e87b7 20432:com.badiyajobs.app/u0a389} (pid=20432, uid=10389) that is not exported from uid 10107

mpadhiar commented 6 years ago

@jamesmontemagno i have investigated this issue and turns out that the MediaPickerActivity on android doesnt request a persistent URI and hence once the activity finishes the access to the URI is no longer valid.

https://stackoverflow.com/questions/40438537/permission-denied-opening-provider-com-google-android-apps-photos-contentprovi

https://stackoverflow.com/questions/25414352/how-to-persist-permission-in-android-api-19-kitkat/29588566#29588566

yasiralijaved commented 6 years ago

Issue Still Open? has anyone found the solution?