bilalsaeed edited a comment on issue #718: URL: https://github.com/apache/cordova-plugin-camera/issues/718#issuecomment-864517005
I resolved the issue by changing the source code in CameraLauncher.java file, the issue is that android 11 does not allow access to URIs created from URI.fromFile from one application to another. For example, in the performcrop method we are generating a `croppedUri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));` and passing it to other activity therefore the receiving application will not have access to the croppedUri and throws an error like Access Denied or Editing is not allowed for this image. So in order to resolve that we need to create a URI from FileProvider.getUriForFile(). I know it may sound silly. but replace with the following. `croppedUri = picUri;` It worked for me on Android 10 and 11. Please let me know your thoughts. Thanks. -- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
