File component could not error

Why when I use the file component to store files, I can successfully save the files in my phone during the companion test, and can successfully obtain and share the files, but after I export the apk, I can’t find the file?

1 Like

Please read at here

That’s not the issue, otherwise it’d throw error 902 (permission denied or never granted).

The file component is unable to save to the applications external directory (the component has a preset prefix, which can’t be changed).

How does that change the accuracy of my statement. This is true in any case. And the blocks would have to be changed accordingly.

What do you mean, the File component is unable to save to the “applications external directory”. I think you mean the ASD. So why introduce new terms that might confuse others?

You claim the File component cannot save to the ASD.
I doubt that.

Because you implied that the user is missing a permission.

I’m sorry, I’m not the one who said ASD was the correct term, you did…

From external storage, getExternalFilesDir() or getExternalCacheDir()

Please, do your research first… Then get back to me.

Test it for me.


Yes, I introduced this term to AI2 and Kodular in early 2019 here, but this term does not come from me, but directly from Google itself:

fileCopyToASD.apk (5.4 MB)

Same for the term I used, so does it really matter which is used if they’re the same? No.

Test my app and you will see that the File component can save / copy files to the ASD - and then the discussion ends. :upside_down_face:

The discussion ended when we BOTH agreed that it doesn’t matter which term you use, they’re both the same :slightly_smiling_face:

And remove all READ permission blocks and also show the Screen.Initialize blocks. Maybe you don’t need the Screen.PermissionGranted event at all.

Sorry I still can’t do it. If I packaged from kodular into an apk, and I want to share the file to any place, then which route should I use to save the file? I double-checked the file in my phone and it is still empty

@kentleow1496 it’s best not to use the File component. It still asks for permissions even when they’re not needed. It can mislead the user, use an extension instead!

Do I use /storage/emulated/0/Android/data/filen_ame.txt to save the file?

Which extension should I use?

@hammerhai Does my app work for you? Yes or no?

I’ll answer this, but first: did you test my app? If so, does it work?

No it doesn’t work, it asks a permission before “copying” whatever file is to be copied… I got to the permission part and closed your application because I was scared of such dialog.

Yes it works, I can see the picture in the file

It works definitely!
Where could be the problem to ask for WRITE permission at Screen.Initialize :question:

Thankfully I have the right one for you!

To see instructions on how the storage extension works with paths, view this post…

To download the storage extension, view the following post and open the “Original reply (includes v3.0.1 and v3.1.1)”…

No, when doing anything with files, the File component will ask for permissions REGARDLESS of it’s path.