title: Android app: Can't save photo. Camera doesn't have permission to save to this location
body: <p>I have a user who is not able to use the camera in my Android app even though she seems to have all the right permissions.</p>
  <p>She is using a <strong>Google Pixel 6 Pro, Android 12 Build/SD1A.210817.037</strong>.</p>
  <p>She has deleted and reinstalled the app. She has deleted storage and cache associated with the app. She is able to use the camera for other apps. She is using the default camera app.</p>
  <p>No one else has complained about this issue, but she is using a recent build update so maybe she's just the first to see it and tell me.</p>
  <p>The popup error message says:</p>
  <blockquote>
  <p>Can't save photo. Camera doesn't have permission to save to this
  location.</p>
  </blockquote>
  <p>In her Settings app, for App Permissions:</p>
  <ul>
  <li>Camera</li>
  <li>Files and Media</li>
  <li>&quot;No permissions denied&quot;</li>
  </ul>
  <p>In her Settings app, for all permissions, :</p>
  <ul>
  <li>Camera: Take pictures and video</li>
  <li>Files and Media: Read the contents of your shared media, Modify or delete the contents of your shared media</li>
  </ul>
  <p>The app permissions:</p>
  <blockquote>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&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.autofocus&quot;
      android:required=&quot;false&quot; /&gt;
  </code></pre>
  </blockquote>
  <p>The app uses a webview and launches the camera from a standard HTML form. This is standard and automatically gives the user the choice of using the camera or file. The image is then normally sent to my server via the form and saved there.</p>
  <blockquote>
  <pre><code>&lt;form action=&quot;upload/&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; &gt;
        &lt;input type=&quot;file&quot; accept=&quot;image/*&quot; name=&quot;image&quot;&gt;
        &lt;input type=&quot;submit&quot;&gt;
  &lt;/form&gt;
  </code></pre>
  </blockquote>
  <p>The user is able to upload an image if she chooses a file, but not if she chooses the camera option. I'm not sure if the error message pops up before or after taking a photo with her camera.</p>
  <p>App code:</p>
  <pre><code>private int MY_PERMISSIONS_REQUEST_CAMERA = 1;
  
  public boolean onShowFileChooser(WebView webView, ValueCallback&lt;Uri[]&gt; filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
          uriArrayCallback = filePathCallback;
  
          if ( (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED
                          || ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
                          || ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
                  )) {
  
              requestPermissions(new String[]{android.Manifest.permission.CAMERA,
                              android.Manifest.permission.READ_EXTERNAL_STORAGE,
                              android.Manifest.permission.WRITE_EXTERNAL_STORAGE},
                      MY_PERMISSIONS_REQUEST_CAMERA);
          } else {
              // has permissions
              openFileChooserInternal(NEW_FILECHOOSER_REQUEST_CODE);
          }
  
          return true;
      }
          
   public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
          if (requestCode == MY_PERMISSIONS_REQUEST_CAMERA) {
              boolean cameraAccepted = grantResults[0] == PackageManager.PERMISSION_GRANTED;
              boolean readExternalAccepted = grantResults[1] == PackageManager.PERMISSION_GRANTED;
              boolean writeExternalAccepted = grantResults[2] == PackageManager.PERMISSION_GRANTED;
              if (cameraAccepted &amp;&amp; readExternalAccepted &amp;&amp; writeExternalAccepted) {
                  openFileChooserInternal(NEW_FILECHOOSER_REQUEST_CODE);
              } else {
              }
          }
      }
  </code></pre>