Closed ray007 closed 1 year ago
Storage in Android is very picky & restrictive... android:requestLegacyExternalStorage="true"
is ignored on API 30+:
Here are some resources that might get you going: https://developer.android.com/training/data-storage/use-cases https://developer.android.com/training/data-storage/manage-all-files
Seems like directing the users to the System Settings to change the access type is the expected approach based on the 2nd link above:
Use the ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION intent action to direct users to a system settings page where they can enable the following option for your app: Allow access to manage all files.
To determine whether your app has been granted the MANAGE_EXTERNAL_STORAGE permission, call [Environment.isExternalStorageManager()](https://developer.android.com/reference/android/os/Environment#isExternalStorageManager()).
@rigor789 thanks for your information, even if I do not like the result.
In the end, accessing files in the shared Downloads
folder will not easily work anymore, and we will need platform specific code to so so.
Will nativescript
provide some helpers to do that, or will everybody have to implement those in their own app?
Is that a fixed
or won't fix
?
The issue itself is mostly a "can't fix" because it's a platform enforced limitation, as for helpers - I can't say for sure, but that would belong to a feature request with some details what the helper would do/look like. Feel free to open one to discuss that part of it further!
the app is showing the setting but the switch is disabled so you can't do anything. how are we supposed to migrate files? maybe at least add a GitHub integration to save and get back files.
Issue Description
To import and export config files (in json format), the
Downloads
directory seemed to be a good location so far.With our new test device with Android 12, that suddenly does not work anymore. Trying to read or write a file there runs into an
EACCESS
error.Looking in settings under
App permissions
, my app is allowedFiles and media
, but it's set tomedia only
and requires manually setting toAllow management of all files
before I can import config files from the downloads directory again.I have even added a line
to my
AndroidManifest.xml
file and an attributeandroid:requestLegacyExternalStorage="true"
to itsapplication
tag, but nothing seems to help so far.Reproduction
No response
Relevant log output (if applicable)
No response
Environment
Dependencies
Please accept these terms