Xamarin - How to upgrade Android app and keep files under android data folder

感情迁移 提交于 2019-12-11 06:04:41

问题


I need to deploy a new version of my Android app made with Xamarin. My app stores files in the following path:

android > data > APP.PACKAGE_NAME > files > data

The problem is those files are wiped after the upgrade and the app needs to resync with the remote server, is this behavior normal or am I missing something ?

What I do is upgrade the version number in the properties > Android Manifest, then Archive and deploy the generated apk on my device.


回答1:


If your device is rooted, it can be the cause of your problem.

Database (Sqlite-net) do not persist between build on Monodroid

The device was somewhat rooted (or not). I have read somewhere that this might be an issue so I followed these steps:

1. Installed KingoRoot
2. Device "was already rooted" (broken), but rooted it with KingoRoot, then crashed
3. Tried to root it again with success
4. UnRooted the device with SuperUser
5. Uninstalled KingoRoot
6. Now data is preserved when compiling/debugging to the device.


来源:https://stackoverflow.com/questions/44154134/xamarin-how-to-upgrade-android-app-and-keep-files-under-android-data-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!