nguyenhoanglam / ImagePicker

A customizable library for selecting images on the device.
Apache License 2.0
598 stars 158 forks source link

Not working for Android 10 devices #121

Closed aldrinjoemathew closed 1 year ago

aldrinjoemathew commented 4 years ago

The library doesn't load any images in Android 10 devices.

Setting requestLegacyExternalStorage as true in the manifest is only a workaround and is not a recommended approach going forward (It will be removed from Android 11 onwards). It'd be best if this is fixed at the earliest.

KelvinPac commented 4 years ago

This hasn't been fixed yet and more android 10 devices are now available. Was just about to update my app then boom'

nguyenhoanglam commented 4 years ago

Hi @aldrinjoemathew @KelvinPac, Version 1.4.0 is now available! Please read What's new and check if your issue has been fixed!

shree-vastava commented 4 years ago

I tried on android 10 with 1.4.0. It doesn't load.

odisoedim commented 4 years ago

same here issues

ParryPatel021 commented 3 years ago

I am using version 1.4.3 still having an issue with captured image from Camera in Android 10 Would you please update on this?

alejandro-rios commented 3 years ago

I'm also using version 1.4.3 and testing with an OnePlus 5T with Android 10 is working ok, @ParryPatel021 can you give more info about your issue?, like which phone model, or the stacktrace of the error, i suppose that would be helpful for the developers of this library

ParryPatel021 commented 3 years ago

I'm also using version 1.4.3 and testing with an OnePlus 5T with Android 10 is working ok, @ParryPatel021 can you give more info about your issue?, like which phone model, or the stacktrace of the error, i suppose that would be helpful for the developers of this library

The issue the library cannot return the file path in path property available in Image Model and this is faced in device Nokia 5.1 having Android 10.

shaon2016 commented 3 years ago

For security reasons you can't get the file path but you can get file Uri. Using this you can convert the Uri to file (Need to create a new file) or byte array. Using this both solution you can upload the image

I have implemented those solutions in my new library. You can check the methods.

https://github.com/shaon2016/ProPicker

riocallos commented 3 years ago

This answer https://stackoverflow.com/a/9989900 worked for me when you want to extract the file path from the uri for Android 10 devices and up.

ArchangelXu commented 3 years ago

Just built a library to support Android 11. Tested on Android 10 (device) and Android 11 (Simulator): https://github.com/ming-xi/MXMediaPicker