Error 2101 with the .APK

Hello,
I have almost finished my application. When I test with the companion everything works. If I create the APK and install it on my samsung Tab, I get errors "2101 the file /Documents/Gestion_Hand/MEquipe.txt could not be found". this file exist in this location and my app has permissions to this folder.
have you an idea ?

Thanks

Hello,

Can you post a screenshot of your relevant blocks?

Here is the block that made an error.

This error only shows up when the APK is installed and I am using the app on my tablet.
With the Companion on this same tablet it works

Are you using Android 11 or 12? This functionality does not work on these versions.

Also, what exactly is PathLocal?

image

Android 11.
I think I tried with something other than legacy with the companion, but it didn't work. So I left legacy.
What should I put?
The PathLocal variable is "/Documents/Gestion_hand"

Is the file

located in the SD card?

If you are, it is recommended to store the file in the ASD (application specific directory), via Scope > App.

No, I haven't SD card. it's on my tablet storage
I tried on compagnon with other than legacy, it's bug.

Why not save it in the ASD?

You do, it is a virtual SD card created by the Android file system, essentially your external storage:

/storage/emulated/0
1 Like

Because I would like to be able to exchange files between several users. It seems easier to me to put all my files in the Media folder of the device.
Here is what the list of my directories returns to me

Set DefaultFileScope = Legacy in the Designer

or use my extension:

See also here: Some basics on Android storage

scope is already on legacy
I tried your extensions. Both versions give me error 908

Post the aia or send it to me via PM (privately).

I send you my AIA in PM
Many thanks

@David_tesson You did NOT set

grafik

and you did also not use the first version of my extension.

1 Like

I did so many tests by changing things everywhere, and I forgot to put things back. sorry

I download, built and installed ReadWrite_ExtVer1.aiak and ReadWrite_ExtVer2.aia. Both: Error 908

in your AIA FileScope is on "APP" you have to put it on "legacy" ?

I hage put your extension in my app. i set Defaultscope = Legacy in designer.
I no longer get the 908 error on startup. But after searching for MEquipe.txt files, I still get error 2101.

If the File was created by Companion before you try to test with the APK, it does not work, because the file was created by another app and no longer be overwritten / accessed by a new app (on Android 11+).

Two options:

  • delete the file via Companion before closing Companion or
  • the file name must be different with Companion and APK.

See also here:

1 Like