I have faced this in the past and again with my new app - a text or Json file created by an old APK version can’t be found by a new version after re-installation.
I use the File component to save the file in the app assets.
Then make a copy of it in the Downloads folder with TaifulFile extension.
In APK test on device, if I uninstall the old version and install a new version, the old file saved in Downloads folder is not found. The file is however found if I merely update the old version with the new.
Attaching the blocks I am using.
The file basically exports the tinyDB data to the device, so that it can be imported by a new installation.
You can access a non-media file created by your app as long as app is installed. Once you uninstall the app, you lose its owner permission and thus you can’t read or write to it.
However, you can still access it with SAF.