Unable write file

I made a application that need to save files on user’s phone, but I find that after recently update, every time when I try to save a file, it will return Error 2103/2104.

I have check whether it have no permission, but it still not work. I can sure my block have no bug.

I have a old app which created by elder kodular version, it can save file.

So, why my new app can’t save file?

1 Like

welcome to Community, can you please show how you are trying to save file? and which file type, try showing your blocks.

1 Like

IMG_20200111_092507

1 Like

1: have you allowed storage permission?
2: try simple name test.txt, without /

1 Like

7 posts were split to a new topic: Unable to write file in Android 10

Finally I have find what the problem is. It is my phone’s problem, but I think every Xiaomi phones which use Android 10 will have this bug.

No, this won’t work on any device with Android version > API 22 (since Android 6, runtime permissions).
It’s not a bug and has nothing to do with Android 10.

As I posted several times, the File component does not ask for WRITE_EXTERNAL_STORAGE permission automatically (if you save a file). You MUST ask for it manually:

Note @Kodular:
But of course: the File component should automatically request WRITE permission.

See also here:

2 Likes
3 Likes

thanks, changed it

2 Likes

We will take a look into that

1 Like

Emmm. Although the file component does not ask for permission by itself, but I still think it is Xiaomi’s problem. After I upgraded to Android 9, it will have two permission control interface,l.
One like this


And another like this

For every app, Only the second control interface can really change the app’s permission.
I had reported this bug to Xiaomi, maybe they will solve it soon.

I don’t understand what you are trying to say.
Please temporarily change the language of your device to English and post the screenshots again.

I also have some Xiaomi test devices with Android 9. So post the apk or aia to reproduce this behavior (which one?).

No I won’t. This problem had been solved

Yes, and exactly in the way that I showed above.

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