-
Notifications
You must be signed in to change notification settings - Fork 331
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
Android 13 Image picker not opening - hasReadPermission function promise always return as false #264
Comments
This is a pretty big problem, given that Google won't accept updates to apps that don't target API level 33 after August 31. Any suggestions for a fix? |
This is fixed in https://github.com/VerianMobile/ImagePicker Its a temporary fix but it works for now. |
@hiteshbasware Thanks, but that gives me an error during build:
|
I think your project is not using androidX that is the reason. If you want you can create your own fok and use old libraries. Preferably if you are using API level 28 or higher you should use androidX. For cordova you have to add following line in config.xml or you can use - https://github.com/dpa99c/cordova-plugin-androidx-adapter |
Hey, is there any update on this issue ? Can we have a approximate deadline for the fix please ? It's a big issue for our clients that are using android 13 and can't import any photo anymore |
I know some people don't like using forks, but I've found this one to be excellent: |
Since targeting Android 13 for library like this must use READ_MEDIA_IMAGES permission instead of READ_EXTERNAL_STORAGE which is now deprecated. |
work for me! thx |
Tried this fork, but getting error on building the app, I am having an ionic app, and i have added And my config.xml is having android TargetSdkversion 33. Please help through it, as I have a production planned for October. And am new to mobile development |
Check Java version, you need Java 11 for sdk33 |
When I ran java -version These are the details I am getting. |
This is not working for me too. I also tried the Verian Mobile and the Spoon consulting forks mentioned above and they don't work either. I also tried updating my Cordova Android to 12.0.0, Java to 17, Gradle and build tools and still nothing works. When clicked, the plugin does not respond and it does not give any error message either. I have tried other plugins too and they all have the same issue once the target sdk has been changed to 33 which is the requirement now from Google. Can someone share if you found a working solution please? This is a big problem. |
Hey for me, verian fork worked, I just did a Java 11 update. |
Thank you @Cap-7 for your response. I don't have a diagnostic plugin. After I updated to Android 12, I needed to update couple of plugins such as File and File transfer. Here is my plugins list. Is there anything you feel might cause an issue with this?
Thanks again for helping out. |
My story was different, in my case I kept my app on android 10.0.0 , so things didn't break as much. |
I was able to finally get this working. What worked for me was in the end change a few things in my environment and after a lot of combination trials, the following set-up works for my project:
Now with the above changes, I am finally able to get the plugin to work. |
Bug Report
Problem
hasReadPermission function promise always return as false, resulting in Image picker not opening the selection window with the check implementation.
What is expected to happen?
hasReadPermission should only return false if permission is not given for images access.
What does actually happen?
READ_EXTERNAL_STORAGE android permission is now divided into 3 different media sub-sections in new Android API version 13 i.e READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO. So App can not find access to required permission returns promise as false.
Information
hasReadPermission & requestReadPermission function in ImagePicker.java is trying to look for old permission on new Android which is not available, hence returns false always.
Command or Code
this.imagePicker.hasReadPermission()
.then((result) => {
// result is always false:boolean
Environment, Platform, Device
Any Android Device with Android 13 OS
Version information
Cordova: 12, node: 16.14.1
Operating System: windows 10, Android Studio: Android Studio Bumblebee 2012.1.1
Checklist
The text was updated successfully, but these errors were encountered: