Skip to content
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

Camera or gallery doesn't open due to maxsdkversion in plugin.xml #894

Closed
3 tasks
bipin-52165 opened this issue Aug 5, 2024 · 2 comments
Closed
3 tasks

Comments

@bipin-52165
Copy link

bipin-52165 commented Aug 5, 2024

Bug Report

camera or gallery doesn't open due to maxsdkversion mentioned as 32

Problem

currently google updated their policy to use minsdkversion is 33 and when I checked in tablet with android version 9 then it doesn't open camera

What is expected to happen?

it should open camera or gallery option

What does actually happen?

it doesn't open camera or gallery option

Information

you guys need to update maxsdkversion in plugin.xml at line no. 58 by 33 or 34 otherwise it will not work in future

Command or Code

Environment, Platform, Device

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@bipin-52165 bipin-52165 changed the title Camera or gallery doesn't open due so maxsdkversion Camera or gallery doesn't open due to maxsdkversion in plugin.xml Aug 5, 2024
@breautek
Copy link
Contributor

breautek commented Aug 5, 2024

That's not right.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
is WRITE_EXTERNAL_STORAGE permission, which only applies to API 32 and lower. It is always rejected on API 33 and later devices.

WRITE permission itself is actually obsolete since API 29 with scoped storage mechanism, but it implicitly grants READ_EXTERNAL_STORAGE up to and including API 32. On API 33+, it will be auto rejected.

Starting with API 33, READ_EXTERNAL_STORAGE is replaced by READ_MEDIA_IMAGES, READ_MEDIA_AUDIO, and READ_MEDIA_VIDEO, which current latest version of this plugin uses (except for the audio permission) if running on an API 33+ environment.

Google has announced that they are going to be locking down on apps requesting the READ_MEDIA_* permissions if the app does not have justification for broad access to the media content. In a future release, likely in a new major release we will be removing the READ_MEDIA permission usage and reworking the code to use the native MediaStore APIs. You can test this change by installing the PR: #889

It will likely require some changes in your API consumption in your app code as it will return content:// paths on android, which is temporary access. For example, if long term access is required, then a file copy operation will be required.

@breautek breautek closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
@bipin-52165
Copy link
Author

It was not working before. I updated maxsdkversion by 33 and tested as well. So don't think it is working with 32

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

No branches or pull requests

2 participants