Android asset will not transfer to local storage on upgrade
When my app runs for the first time, it copies a number of .json files from the android Assets/files folder to the user's internal storage:
This has always worked without issue.
I recently released an update, which required an additional file to be copied from/to the same folders. Everything works fine for a new install, but with an upgrade it results in:
System.IO.FileNotFoundException: Could not find file "/data/user/0/com.My.App/files/json/filename.json"
This is for the new file only. All other files are found.
I realised when testing on a Huawei device that disabling the feature Settings > System & updates > Backup & restore > Auto-restore – Restore backed up settings and data to apps when they are reinstalled, caused the file to be transferred successfully. But this loses all the user's previous settings.
Has anyone experienced this same issue? Is there a way of forcing the new file to be saved to local storage on upgrade? Some configuration setting I'm missing perhaps.
Thanks in advance
You could ask this question on Huawei developer forum.
TThanks for your reply.
However, my description is perhaps misleading. It happens on all the devices I've tried, including Pixel. It's just that I happened to discover the cause on a Huawei device.
Sign in to comment