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/05/19 10:40:20 UTC

[GitHub] [cordova-plugin-file] sudeekshachip1003 commented on issue #426: Storage updates in Android 11

sudeekshachip1003 commented on issue #426:
URL: https://github.com/apache/cordova-plugin-file/issues/426#issuecomment-843976860


   > I would like to invite people to try out my fork and give it a test: https://github.com/breautek/cordova-plugin-file/tree/feat/api30
   > 
   > My fork removes the `requestLegacyExternalFlag` which means it should work on both API 29 and API 30+. It ensures that it prompts for the proper permission in read/write external storage.
   > 
   > Here are some highlight changes:
   > 
   > * It's possible that you've already granted or denied external storage permissions, in which case it may just work or it may not work. If you're getting a file not found kind of errors, or file listings are simply empty when you expect there to be content, that probably means you're lacking permissions. Android does not tell us that a file exists but you lack permissions to view; it just gives a file not found error. I assume this is for privacy reasons.
   > * You can use `adb shell pm reset-permissions` to reset your permissions on **all** apps back to a state of "not requested", so that you can test as if the user is running your app for the first time.
   > * `externalRootDirectory` is readable, but not writable. You cannot create directories or files inside this directory anymore.
   > * I used https://github.com/breautek/cordova-file-api30-test-app as a test app. If something is not working right for you on my fork, feel free to make a pull request and add a test case.
   > * I've seen Google is cracking down, requiring external use via `READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE`; in order to use these permissions (and this plugin for accessing external storage) you will need to give justification. You'll going to have to evaluate if your app **needs** external storage access, and if not, then start migrating to internal storage. As a result of this, I'm planning on making this plugin add the external storage permissions as a configurable option.
   > * This plugin is currently not compatible with `cordova-android@10/nightly`. So please only test using `cordova-android@9.1`
   
   Im having a use case of reading the files from shared storage which is failing in android 11 currently. I had tried your solution. It asks for the permissions required and requestLegacyExternalFlag is removed. But still unable to read the files. 
   
   As the new apps would need to target SDK 30, any workaround for this issue? Any way to read files from shared storage(Downloads/images..).
   
    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:
users@infra.apache.org



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