Error 908: permission not granted

Where exactly are you trying to write? Please provide a screenshot of your relevant blocks

Taifun

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

Taifun

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. :frowning:

No, no… This not work :frowning:

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

Taifun

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…

Taifun

1 Like

I think I found the problem I just changed the path from

/Download/Query.doc

just removed the first slash and the new path

Download/Query.doc

. 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…

Taifun

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

/Android/data/io.makeroid.companion/files

See again Some basics on Android storage system

Taifun

1 Like

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…

Taifun

1 Like

https://www.ghisler.ch/board/viewtopic.php?t=77921&sid=cafc42c5193b8a5789fc88c5811e6f89

Hey, after a lot of nerves, I solved the problem… It’s not very elegant, but it works. As far as I read android 13 no longer allows us to access our app’s ASD directory, but I found a file explorer that allows us to…

https://forum.xda-developers.com/t/access-android-data-on-android-13-without-root.4480683/

A huge thank you to everyone for their help, and special thanks to Mr Tayfun :v:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.