Hello everyone, I have a basic problem that rainbows also have. Android 13 phone gives ** WRITE_EXTERNAL_STORAGE has been denied.** This happens when I try to write to a file located in an external directory. I’ve tried asking for permissions when starting the app and that doesn’t help. I am attaching a screenshot.
Write permission isn’t required for Android 10+ devices … Remove the that block and try again …
Where exactly are you trying to write? Please provide a screenshot of your relevant blocks
My project is quite large, but I give some of the fields where I specify the file and when I write in it.
From the screenshot unfortunately we can’t see, where exactly you are trying to write…
What is the value of the global variable File_Name?
Also see Some basics on Android storage system
The value of the file name variable is: /Quary.doc or in other words the main directory where all visible folders such as download, document are located. I tell it to just create a text file and add lines from each record to it.
With a /, I think I’m specifying a relative path to /storage/emulated/0/. If this is the mistake, please tell.
I removed the block asking to grant rights to the media, but again when reinstalling the app it asks if I allow access to the media, I allow and I still get this error message. I can’t find my mistake. I tried changing it and Scope on Legasy, Asset, Sharing… and ultimately to no avail.
No, no… This not work
Ok… so you found your issue… after reading the basics Some basics on Android storage system you now know, that you can write only to shared storage /Download or /Documents and only if the file is owned by your app
I understood well that the path I have to point to the application is /Documents/Query.doc… But how do I show it that it is owned by my application??? Tried changing the path to the one above but still got this error, then uploaded the file to Asset Manager, again to no avail…
You stored the file in the assets of the app… the assets however are read only. . Before being able to write, you have to copy the file first to ASD and write there… you do not necessarily need shared storage then…
I think I found the problem I just changed the path from
just removed the first slash and the new path
. The app no longer gives me an error and writes to the file. New problem when I search for it in the phone I can’t find the file. Do you know where it is recorded with such a route??
This depends on the file scope… the default is App, which means you can find the file in the ASD in subdirectory Download…
To view the file use Total Commander…
Ok Tayfun, I installed the Total Commander app and choose internal storage:
Then I select the Download folder:
But the file is not found there…
Should I change the scope on file component or change scope of the entire application? I have currently chosen to be on the App…
While testing in the companion app, the ASD is in
See again Some basics on Android storage system
Mr. Taifun, I understand what you are saying, but android 13 does not allow access to the ASD of the application. I was only able to get into it if I connected it to my computer at home with a USB cable. I tried copying the contents of the file to another file in a directory visible to me, but it still denies me access. I also tried moving the file to another visible directory, it still refuses. Any ideas how to get it to be able to open the edit file on the phone?
I do not have an Android 13 device, only Android 12, and also there access is restricted to
/Android/data, but Total Commander is able to access that directory… just try again… storing in ASD is the more simple strategy…
After reading the basics you are able to understand the restrictions and build your app according to your needs…
If your requirement is to see the file, what exactly prevents you from copying the file to shared storage then?
We can look at this after you providing a screenshot of your relevant blocks…