You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/04/06 22:37:44 UTC

[GitHub] [cordova-plugin-camera] ishtiaqshariffTopdevz opened a new issue #720: Android 10 and Android 11 cache file not found permission denied

ishtiaqshariffTopdevz opened a new issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720


   # Bug Report
   Android 10 and Android 11 cache file not found permission denied. Like once image is taken which will save  in External Storage of the device but the when it tries to pull the image for further process it showing permission denied exception.
   ## Problem
   
   ### What is expected to happen?
   
   
   
   ### What does actually happen?
   
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   {
                   quality: 20,
                   destinationType: Camera.DestinationType.FILE_URI,
                   sourceType: Camera.PictureSourceType.CAMERA,
                   allowEdit: false,
                   encodingType: Camera.EncodingType.JPEG,
                   correctOrientation: true,
                   saveToPhotoAlbum: false
               }
   
   
   
   ### Command or Code
                   window.resolveLocalFileSystemURL(imageURI, resolveOnSuccess, moveFileError);
   
   resolveOnSuccess (entry) {
   var url = '';
                       var d = new Date();
                       var n = d.getTime();
   
                       //new file name
                       var newFileName = n + ".jpg";
                       var myFolderApp = "plugin_images";
   window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSys) {
                           fileSys.root.getDirectory(myFolderApp,
                               { create: true },
                               function (directory) {
                                   entry.moveTo(directory, newFileName, function (new_entry) {
   }
     },moveFileError);
                               },
                               moveFileError);
                       },
                          moveFileError);
                   }
                   function moveFileError(error) {
                       console.log('Error '+error.code+': '+error.message);
                   }
   ### Environment, Platform, Device
   Android 10 and Android 11
   
   
   ### Version information
   cordova-plugin-camera 5.0.2-dev "Camera"
   8.1.2 (cordova-lib@8.1.1)
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [ ] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] deliverymanager commented on issue #720: Android 10 and Android 11 cache file not found permission denied

Posted by GitBox <gi...@apache.org>.
deliverymanager commented on issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720#issuecomment-824186146


   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] PieterVanPoyer commented on issue #720: Android 10 and Android 11 cache file not found permission denied

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer commented on issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720#issuecomment-855278533


   Closing ticket due to lack of response, due to missing reproduction repo.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] PieterVanPoyer commented on issue #720: Android 10 and Android 11 cache file not found permission denied

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer commented on issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720#issuecomment-843530965


   https://cordova.apache.org/docs/en/10.x/guide/platforms/android/index.html#requirements-and-support
   @ssnielsen  you shouldn't be targeting 30 already. The 30 should be possible when the next cordova-android version is released.
   
   ![image](https://user-images.githubusercontent.com/33040889/118718428-833d4c80-b827-11eb-9ecb-33d8ee13e540.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] ssnielsen commented on issue #720: Android 10 and Android 11 cache file not found permission denied

Posted by GitBox <gi...@apache.org>.
ssnielsen commented on issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720#issuecomment-824872966


   We're in the middle of bumping our app's API target from 29 to 30, and we might be experiencing something of the same nature.
   
   We read from the fileUrl (that looks like `file:///storage/emulated/0/Android/data/{packageName}/cache/1619099822506.jpg`) we get back in the success callback we pass to `camera.getPicture` using a normal `XMLHttpRequest` (old-fashioned, I know 😄).
   When targeting 29, we can read from the url, but on 30, we get a generic `ERR_ACCESS_DENIED` in Chrome's dev tools. I'm guessing it's due to the scoped file access changes that was introduced as part of API target 29 (that we opted out of using the `requestLegacyExternalStorage` flag.
   
   What I'm not quite sure of is why this plugin would be affected by changes to file access - I'd expect that the files are stored in a cache directory, but I'm not 100% into the inner works of this plugin. Is it preferring external storage?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] PieterVanPoyer closed issue #720: Android 10 and Android 11 cache file not found permission denied

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer closed issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] ssnielsen edited a comment on issue #720: Android 10 and Android 11 cache file not found permission denied

Posted by GitBox <gi...@apache.org>.
ssnielsen edited a comment on issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720#issuecomment-824872966


   We're in the middle of bumping our app's API target from 29 to 30, and we might be experiencing something of the same nature.
   
   We read from the fileUrl (that looks like `file:///storage/emulated/0/Android/data/{packageName}/cache/1619099822506.jpg`) we get back in the success callback we pass to `camera.getPicture` using a normal `XMLHttpRequest` (old-fashioned, I know 😄).
   When targeting 29, we can read from the url, but on 30, we get a generic `ERR_ACCESS_DENIED` in Chrome's dev tools. I'm guessing it's due to the scoped file access changes that was introduced as part of API target 29 (that we opted out of using the `requestLegacyExternalStorage` flag.
   
   What I'm not quite sure of is why this plugin would be affected by changes to file access - I'd expect that the files are stored in a cache directory, but I'm not 100% into the inner works of this plugin. Is it preferring external storage?
   
   **EDIT:** I looked a bit more into it. I tried bumping to cordova-android 9.1.0 (from 9.0.0), which I believe resolved the issue I had described. I suspect it was resolved by this fix: https://github.com/apache/cordova-android/pull/1111


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] PieterVanPoyer commented on issue #720: Android 10 and Android 11 cache file not found permission denied

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer commented on issue #720:
URL: https://github.com/apache/cordova-plugin-camera/issues/720#issuecomment-843532045


   @ishtiaqshariffTopdevz can you make a minimal reproduction issue? That would help a lot: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org