nguyenhoanglam / ImagePicker

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

Not working in android 33 #147

Closed aerocube-tech closed 1 year ago

jateengadhiya commented 1 year ago

WhatsApp Image 2022-10-18 at 10 17 14 AM

Please find the attached Screenshot. It working fine on android 31. But when it switch to android 33. This show error on reading media file. Please check and verify.

ZoeVale commented 1 year ago

Hello any idea? It's seam a permission problem

nguyenhoanglam commented 1 year ago

Hi guys, I don't have any device running api 33. So I test it on emulator but do not see any permission issue. It would be nice if you guys help me debug the error while I'm earning money to buy new device. Thanks a lot!

ZoeVale commented 1 year ago

hi @nguyenhoanglam about test this issue you can start application accept permission (if you have any) and then go to settings of your app and remove permission.

You notice that permission are for you library not for the application so you can't resolve the issue

aerocube-tech commented 1 year ago

Got the Solution. You required extra permission for android Tiramisu (Android 13) Read Media Images

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />

aerocube-tech commented 1 year ago

please check the @link

petrstetka commented 1 year ago

@aerocube-tech How did you solve it? I tried add READ_MEDIA_IMAGES permission into AndroidManifest and runtime asked on this permission but I am still getting blank screen like on screenshot above

aerocube-tech commented 1 year ago

@petrstetka This is how you set the permission in manifest.

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" tools:replace="android:maxSdkVersion"/>

and later you have to fork this library into your project and update permission request relevant sdk version. If still not get it please contact me on hello@aerocube.tech

nguyenhoanglam commented 1 year ago

@aerocube-tech @jateengadhiya @ZoeVale @petrstetka Version 1.5.5 is available now. Please help me check it out and let me know if the bug is gone.

Sorry for letting you guys wait for so long... 😅

zoelounge commented 1 year ago

Ho @nguyenhoanglam i try in the afternoon. At a moment I resolve problems with a tricks.

On OnCreate I call my fun "checkPermission" so if there's some problems I resolve.

But it doesn't run if user go to steering's and toggle the permissions.

nguyenhoanglam commented 1 year ago

@zoelounge You can try v1.5.5 without using any tricks. READ_EXTERNAL_STORAGE has been removed on Android 13. That's why the permission request always fails. So, I've added READ_MEDIA_IMAGES to support Android 13 or higher. Please check it out!

zoelounge commented 1 year ago

Ok I'll try it in the afternoon. Thanks so much for your job. 👍

petrstetka commented 1 year ago

@nguyenhoanglam Version 1.5.5 works for me on Android 13. Thank you! In my opinion, this issue can be closed and be considered as resolved.