Issue in create file in mobile (ex:- test.txt)

It will be created if don’t exist

1 Like

Just a guess, Android 10

1 Like

Yes you are right.
:+1:

1 Like

issue is file not create

is this an Android 10 device? up to now we only have a guess…

you are not allowed to store your file in a directory of your choice anymore…
try to remove the slash to store it in the private directory of the app


Taifun

1 Like

You must ask for WRITE_EXTERNAL_STORAGE permission, because the File component does not ask for it automatically.

I really don’t know how many times I’ve reported this issue (bug) since September 2019:

So try this:

Build the APK and check it on your Android 10 device.
On my test devices with Android 10 it works fine.

Yes, that’s right, but that only applies if you target API 29 (Android 10):
targetSdkVersion = 29.

And this is not possible with Kodular at the moment, without adjusting the Manifest.

https://developer.android.com/training/data-storage
Scoped storage
To give users more control over their files and to limit file clutter, apps that target Android 10 (API level 29) and higher are given scoped access into external storage, or scoped storage, by default. Such apps have access only to the app-specific directory on external storage, as well as specific types of media that the app has created.

thank you, you are correct… (as always… :wink: )

if you want to remind our Kodular friends, then just tag them like this @Kodular
Taifun

1 Like

Whats the Issue exactly in details?
I can look into it tomorrow :slightly_smiling_face:

As I said, the issue (bug) is, that

Here is now a list with the block names and if they ask for permission:

  • “Save File” ← Does NOT ask → Does ask after next release
  • “Append To File” ← Does NOT ask → Does ask after next release
  • “Read From” ← Does ask
  • “Delete” ← Does ask
  • “Create Directory” ← Does NOT ask → Does ask after next release

I will edit this post if there was any progress done on these blocks to let them ask herself the needed permission :slight_smile:

3 Likes

Thanks!
On this occasion: another bug of the File component is that it is not possible to copy a file from the assets to the external storage (with the compiled app / APK, Companion works). I have also reported this bug many times. @Mika

grafik

2 Likes

What’s the problem with the block?
Missing permission? Any details? Then I can look into that too.

No, even if WRITE permission is granted, it doesn’t work. Nothing happens, no error message …

Can you share a simple apk? Then I can test it with logcat if there is any message :slight_smile:

Just a question but look at the input path. It starts with 2 //
That means the file path is external. And you know the companion stores his files external. That’s why it works for you with companion but not as apk

It starts with 2 // That means the file path is external.

No, this should be the path to the assets:
File_copyFromAssets.apk (4.9 MB)

Or what is the correct path to the assets in Kodular?

Taifun’s extension is not our component. So you can not expect that his block description is the same for our component.
If it’s a asset file then just use it’s name like “text.txt” and not “//text.txt

Of course, you are right, but I tried every path, also without a slash.

Doesn’t work too.
See here:

grafik