EinfachHans / cordova-plugin-advanced-imagepicker

Cordova Plugin for an advanced (multiple) ImagePicker
29 stars 48 forks source link

Android 12 crash when trying to use camera #48

Closed tempo-riz closed 9 months ago

tempo-riz commented 2 years ago

Bug Report

Current Behavior: Open the plugin panel, touch the top left camera icon to acces camera -> crashes or reload the app with following security error :

Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.sec.android.app.camera/.Camera clip={text/uri-list hasLabel(0) {U(content)}} (has extras) } from ProcessRecord{7de7c84 17790:myappid/u0a473} (pid=17790, uid=10473) with revoked permission android.permission.CAMERA

Expected Behavior: be able to use camera

Environment information: Android 12 plugin version : 1.6.2 cordova version 11.0.0 cordova android version 11.0.0

Thanks for working on this plugin !

tempo-riz commented 2 years ago

if that can help I tried to check for permissions.CAMERA with this plugin https://www.npmjs.com/package/cordova-plugin-android-permissions and it says I do have permission

tempo-riz commented 2 years ago

I tried some ideas I found there https://androiderrors.com/android-permission-denial-starting-intent-with-revoked-permission-android-permission-camera/

and what did work for me was chaning this <uses-permission android:name="android.permission.CAMERA"/> to <uses-permission android:name="android.permission.CAMERA" android:required="true" android:requiredFeature="true"/> in my AndroidManifest.xml

clarklight commented 1 year ago

@tempo-riz Yer, it is also happening on Android 13 as well, may i ask how do you change that Android Manifest.xml?? That link you posted above doesn't work anymore.

Thanks

clarklight commented 1 year ago

Weird, i initially had that issue, but i added the Permission plugin, and removed cordova android, readded that, and rebuilt the app, and that issue went away.... no idea how...