title: Problem with access to gallery Android 11 - Access denied unable to save cropped image
body: <p>Perhaps someone has already encountered this problem and found a solution</p>
  <p>I have an app built with cordova-android - 9 and targetSdkVersion - 29</p>
  <p>When I try to get a picture from the camera after processing the photo with a cropper, an error occurs: &quot;<strong>Access denied unable to save cropped image</strong>&quot;</p>
  <p>I have experimented with permissions <strong>WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, MANAGE_EXTERNAL_STORAGE</strong> in app\src\main\AndroidManifest.xml
  I also added android: requestLegacyExternalStorage=&quot;true&quot;</p>
  <p>In app\build.gradle added compileSdkVersion 29 and targetSdkVersion 29</p>
  <p>I read a ton of documentation on developer.android, tried solutions from github and stackoverflow, but unfortunately nothing worked</p>
  <p>If anyone knows a solution to the problem, please help. I would be grateful for any idea or hint for a solution</p>
  <p>My AndroidManifest.xml:</p>
  <pre><code>   ...
     &lt;application android:hardwareAccelerated=&quot;true&quot; android:icon=&quot;@mipmap/ic_launcher&quot; android:label=&quot;@string/app_name&quot; android:supportsRtl=&quot;true&quot;&gt;
     ...
    
    &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.USE_FINGERPRINT&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.READ_CONTACTS&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.WRITE_CONTACTS&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.GET_ACCOUNTS&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
     &lt;uses-feature android:glEsVersion=&quot;0x00020000&quot; android:required=&quot;true&quot; /&gt;
     &lt;uses-feature android:name=&quot;android.hardware.location&quot; /&gt;
     &lt;uses-feature android:name=&quot;android.hardware.location.gps&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; android:required=&quot;false&quot; /&gt;
     &lt;uses-feature android:name=&quot;android.hardware.camera&quot; android:required=&quot;false&quot; /&gt;
     &lt;uses-feature android:name=&quot;android.hardware.camera.front&quot; android:required=&quot;false&quot; /&gt;
     &lt;uses-permission android:name=&quot;com.android.launcher.permission.INSTALL_SHORTCUT&quot; /&gt;
     &lt;uses-permission android:name=&quot;com.android.launcher.permission.UNINSTALL_SHORTCUT&quot; /&gt;
     &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
     ...
  
  </code></pre>
  <p>build.gradle:</p>
  <pre><code>...
  android {
      defaultConfig {
          versionCode cdvVersionCode ?: new BigInteger(&quot;&quot; + privateHelpers.extractIntFromManifest(&quot;versionCode&quot;))
          applicationId privateHelpers.extractStringFromManifest(&quot;package&quot;)
  
          if (cdvMinSdkVersion != null) {
              minSdkVersion cdvMinSdkVersion
          }
  
          if (cdvMaxSdkVersion != null) {
              maxSdkVersion cdvMaxSdkVersion
          }
  
          if(cdvTargetSdkVersion != null) {
              targetSdkVersion cdvTargetSdkVersion
          }
      }
  ...
  </code></pre>
  <p>config.xml:</p>
  <pre><code>...
  &lt;plugin name=&quot;es6-promise-plugin&quot; spec=&quot;^4.2.2&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-add-swift-support&quot; spec=&quot;^2.0.2&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-android-permissions&quot; spec=&quot;^1.0.0&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-device-motion&quot; spec=&quot;^2.0.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-file&quot; spec=&quot;^6.0.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-file-transfer&quot; spec=&quot;^1.7.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-network-information&quot; spec=&quot;^2.0.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-splashscreen&quot; spec=&quot;^5.0.2&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-touch-id&quot; spec=&quot;^3.4.0&quot;&gt;
          &lt;variable name=&quot;FACEID_USAGE_DESCRIPTION&quot; value=&quot;For quick authentication.&quot; /&gt;
      &lt;/plugin&gt;
      &lt;plugin name=&quot;cordova-plugin-contacts&quot; spec=&quot;^3.0.1&quot;&gt;
          &lt;variable name=&quot;CONTACTS_USAGE_DESCRIPTION&quot; value=&quot;Your contact list data will be sent to the server and used to check if your contacts are using this application.&quot; /&gt;
      &lt;/plugin&gt;
      &lt;plugin name=&quot;cordova-plugin-whitelist&quot; spec=&quot;^1.3.3&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-appavailability&quot; spec=&quot;^0.4.2&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-ios-keychain&quot; spec=&quot;~3.0.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-camera&quot; spec=&quot;^4.0.3&quot;&gt;
          &lt;variable name=&quot;CAMERA_USAGE_DESCRIPTION&quot; value=&quot;The camera is used to scan QR codes.&quot; /&gt;
          &lt;variable name=&quot;PHOTOLIBRARY_USAGE_DESCRIPTION&quot; value=&quot;This app requires photo library access to function properly.&quot; /&gt;
      &lt;/plugin&gt;
      &lt;plugin name=&quot;cordova-plugin-listpicker&quot; spec=&quot;^2.2.2&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-ionic-webview&quot; spec=&quot;^4.1.0&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-android-fingerprint-auth&quot; spec=&quot;~1.5.0&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-ionic-keyboard&quot; spec=&quot;^2.1.3&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-statusbar&quot; spec=&quot;~2.4.3-dev&quot; /&gt;
      &lt;plugin name=&quot;cordova-android-support-gradle-release&quot; spec=&quot;^3.0.0&quot;&gt;
          &lt;variable name=&quot;ANDROID_SUPPORT_VERSION&quot; value=&quot;27.+&quot; /&gt;
      &lt;/plugin&gt;
      &lt;plugin name=&quot;cordova-plugin-decimal-keyboard-wkwebview&quot; spec=&quot;~1.0.3&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-qrscanner&quot; spec=&quot;^3.0.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-card-io&quot; spec=&quot;~2.1.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-secure-key-store&quot; spec=&quot;~1.5.4&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-vibration&quot; spec=&quot;~3.1.1&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-shortcuts-android&quot; spec=&quot;~0.1.0&quot; /&gt;
      &lt;plugin name=&quot;cordova-plugin-cutout&quot; spec=&quot;~1.0.10&quot; /&gt;
  ...
  </code></pre>