Yes... and I have occasionally wondered what the solution might be there, since it is a cause of a number of issues (also TinyDB for similar reasons). It is a fairly deep problem that would require some architectural changes to how the companion works that I'm not sure we'd be comfortable making at this point.
can it be that this is the same bug ?
this bring "true" in the APK even if the file do not exist.
the list seem to have 10 files no matter what i do.
Please prepare a test project as small as possible, which elicits this behavior and add it into this thread
Taifun
No, checked with Compnion & APK on Android 13.
Uninstall the app first, i.e. before you test it again.
thanks, i do not know why the file.exist brought true, when the file didn't exist, but i used a work around.
thanks for the help.
It does not show "true" if the file doesn't exist.
Google does automatic backups of app specific directories, so it might be possible that it restored files from previously backed up installation of your app. In this case, you could manually go in using adb and delete the contents of the directory.
i tried to delete it, but it seems not to work:
it should have deleted the file after writing it in label5 but it doesn't,
i can see the file have the correct path, but it still do not delete it, and the number of files in this directory getting higher then 1.
did you set the file scope to App?
for the File.Delete method try a relative path, which start wth /Pictures...
Taifun
as you can see in the second image, it give the correct path:
but still do not delete.
I can see that you are using an absolute path...
The suggestion was
Also what about
Taifun
i will try the relative path.
the file.delete have only file name, not a scope, i added the scope as the absolute path
As I've already showon in post #12:
If the FileScope = App you must set the subfolder and the fileName:
/Pictures/_app_inventor_image_picker/<fileName>
The File component does not use an absolute or full path.
cool, thanks i try it now, i wished it was written in the documentation.
This is not a relative path, but the subfolder of the ASD and the fileName.
If you want to use a relative path you must set FileScope = Legacy.
See also here: Some basics on Android storage system
yes i have read it already, but i do not know what components need what.
Rebuild my blocks and try ...
thanks, i will do that.