Hello, I have a problem when trying to save data to a file that it pops up asking permission to save it and once I accept or deny it crashes the app? It works if I do it but still crashes the app? .
I looked at some similar posts here and I have all the defaults set to legacy storage and the scope to legacy but the app still crashes for some reason
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Sorry I just didn't think the blocks were needed as like i said in the post the code all works it just crashes the app when it asks for permission to save/access storage.
how did you set the default filescope in the Screen properties?
how did you set the file scope for the file component?
which Android version are you using for your tests?
I did say in the post that I set the default scope properties on screen 1 and the file component both to legacy. And I check to see if the file saves and I'd read okay after restarting the app and both worked.
you have to start your tests from the beginning... store the file in ASD (using file scope App) and read it from there
file scope should be App
default file scope should be Legacy
you can access the file for example using total commander, see also
Nope I am using the downloaded app. I see the file stored in the apps directory under files. Yet when I try to read the file it says it can't find it. It's searching for the same file name in the same folder. I tried deleting the file and restarting the process, same thing.
Yet when I had the scopes all set as legacy it was able to find the file fine and it was stored outside of the app directory
I am sorry but how would that change anything ? The rest of the app works fine and has been working fine for a while. This is the only new addition so the only problem can be in the reading and writing the file and an issue with accessing the ASD. After reading a few other posts about the file component it seems you can't read a file from the ASD anymore from what I understand so I will have to go back to using legacy and just try to figure out why accepting the permissions causes the app to crash.
well, if something is not working, someone else can take a look at your simple test project...
I myself will not download a complex app to do some bug hunting, but probably you will find someone else, who likes to do that...
Well I thought I would try one last thing which was to clear the app data and uninstall completely then re download it(instead of pushing updates to the app) and now it's decided that it wants to work. So I have no idea but it seems to work now?
Everything you said in this thread makes no sense at all.
I took a closer look at your aia. In this aia you set DefaultFileScope = App and also FileScope = App (and both permissions READ / WRITE enabled in the Designer for the File component). This means that all files saved via the File component are saved in the ASD (under all Android versions. However, READ & WRITE permissions are only required for Android < 4.4 (API 19, KitKat).
So I removed the Solution marker (from your post #19) because uninstalling and reinstalling the app is definitely not a solution. This will only confuse others (and obviously yourself, by the way).