4

Perhaps someone has already encountered this problem and found a solution

I have an app built with cordova-android - 9 and targetSdkVersion - 29

When I try to get a picture from the camera after processing the photo with a cropper, an error occurs: "Access denied unable to save cropped image"

I have experimented with permissions WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, MANAGE_EXTERNAL_STORAGE in app\src\main\AndroidManifest.xml I also added android: requestLegacyExternalStorage="true"

In app\build.gradle added compileSdkVersion 29 and targetSdkVersion 29

I read a ton of documentation on developer.android, tried solutions from github and stackoverflow, but unfortunately nothing worked

If anyone knows a solution to the problem, please help. I would be grateful for any idea or hint for a solution

My AndroidManifest.xml:

   ...
   <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
   ...
  
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.USE_FINGERPRINT" />
   <uses-permission android:name="android.permission.READ_CONTACTS" />
   <uses-permission android:name="android.permission.WRITE_CONTACTS" />
   <uses-permission android:name="android.permission.GET_ACCOUNTS" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   <uses-permission android:name="android.permission.WAKE_LOCK" />
   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
   <uses-feature android:glEsVersion="0x00020000" android:required="true" />
   <uses-feature android:name="android.hardware.location" />
   <uses-feature android:name="android.hardware.location.gps" />
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.CAMERA" android:required="false" />
   <uses-feature android:name="android.hardware.camera" android:required="false" />
   <uses-feature android:name="android.hardware.camera.front" android:required="false" />
   <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
   <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />
   <uses-permission android:name="android.permission.VIBRATE" />
   ...

build.gradle:

...
android {
    defaultConfig {
        versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
        applicationId privateHelpers.extractStringFromManifest("package")

        if (cdvMinSdkVersion != null) {
            minSdkVersion cdvMinSdkVersion
        }

        if (cdvMaxSdkVersion != null) {
            maxSdkVersion cdvMaxSdkVersion
        }

        if(cdvTargetSdkVersion != null) {
            targetSdkVersion cdvTargetSdkVersion
        }
    }
...

config.xml:

...
<plugin name="es6-promise-plugin" spec="^4.2.2" />
    <plugin name="cordova-plugin-add-swift-support" spec="^2.0.2" />
    <plugin name="cordova-plugin-android-permissions" spec="^1.0.0" />
    <plugin name="cordova-plugin-device-motion" spec="^2.0.1" />
    <plugin name="cordova-plugin-file" spec="^6.0.1" />
    <plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
    <plugin name="cordova-plugin-network-information" spec="^2.0.1" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-touch-id" spec="^3.4.0">
        <variable name="FACEID_USAGE_DESCRIPTION" value="For quick authentication." />
    </plugin>
    <plugin name="cordova-plugin-contacts" spec="^3.0.1">
        <variable name="CONTACTS_USAGE_DESCRIPTION" value="Your contact list data will be sent to the server and used to check if your contacts are using this application." />
    </plugin>
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-plugin-appavailability" spec="^0.4.2" />
    <plugin name="cordova-plugin-ios-keychain" spec="~3.0.1" />
    <plugin name="cordova-plugin-camera" spec="^4.0.3">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="The camera is used to scan QR codes." />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="This app requires photo library access to function properly." />
    </plugin>
    <plugin name="cordova-plugin-listpicker" spec="^2.2.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.1.0" />
    <plugin name="cordova-plugin-android-fingerprint-auth" spec="~1.5.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
    <plugin name="cordova-plugin-statusbar" spec="~2.4.3-dev" />
    <plugin name="cordova-android-support-gradle-release" spec="^3.0.0">
        <variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-decimal-keyboard-wkwebview" spec="~1.0.3" />
    <plugin name="cordova-plugin-qrscanner" spec="^3.0.1" />
    <plugin name="cordova-plugin-card-io" spec="~2.1.1" />
    <plugin name="cordova-plugin-secure-key-store" spec="~1.5.4" />
    <plugin name="cordova-plugin-vibration" spec="~3.1.1" />
    <plugin name="cordova-plugin-shortcuts-android" spec="~0.1.0" />
    <plugin name="cordova-plugin-cutout" spec="~1.0.10" />
...

0 Answers0