What does "second version" mean?
It should actually mean that the second version only differs in the version code (and more functionality) from the first version, but has the same packageName (project name, e.g.: myHealth.aia). Otherwise it would be a new app.
Show your blocks (especially where you store data, TinyDB).
My app consists of 2 screens. Screen1 Enables entering, changing, and searching measurements, ScrMyData handles the basic data. Screen1 has > 2200 blocks, ScrMyData has > 600 blocks. Therefore I only include snippets here.
I have now changed all file related properties to shared:
Here the respective blocks for the storing of the file:
I now get Error 908: the permission WRITE_EXTERNAL_STORAGE has been denied.
Since the text file was already created with the Companion App (i.e. another app), the file cannot be deleted or recreated (saved) with the APK. The file name must be changed beforehand.
Try this:
and do not run the app with Companion. Just build the APK and try.
Note:
You can also add a timestamp to the filename then it would work with Companion and the APK too.
I used the apk. (And I wrote the second 'If', because I suspected that my delete statement doesn't work as I expected.) BTW I also tried it with FileScope Legacy. Then the file was not found - as expected.
Coding it as I posted, the error label looks like that:
@Taifun: Yes I'm aware that there are alternative solutions, but I found the simple file solution the most sympathtic. It's not the most elegant, I have to admit. But when I stumbled about my Delete.File issue, I wanted to clarify, what went wrong. @Anke: The file name is:
and I created it with the apk.
I didn't change the project name, but I disinstalled it and the installed it again. Could that be the reason?