Nativescript: file saved in fs.knownFolders.currentApp().path is deleted on App updates

Created on 23 Sep 2017  路  3Comments  路  Source: NativeScript/NativeScript

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

Didn't find anything related

Tell us about the problem

I save my app data via lokijs in to .db file under fs.knownFolders.currentApp().path + "loki.db". On updating the app via Google Play loki.db does not exist anymore.

Which platform(s) does your issue occur on?

Android 7.0

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.2.0
  • Cross-platform modules: 3.2.0
  • Runtime(s): 3.2.0
  • Plugin(s): loki-nativescript-adapter 1.0.3

Please tell us how to recreate the issue in as much detail as possible.

Save a file with file-system and update app

Is file-system intended to save persistently over app updates? If not, how can i achieve this? nothing related in the docs

question

Most helpful comment

@cgebe the currentApp folder is the root folder of your application. When updating the app it is expected that all source files and folder will be updated respectively. To store an information that will not be deleted on source update you can use documents folder and even create your own subfolder. It can still be manually deleted from the user but it won't be deleted when you are updating the application source.

All 3 comments

@cgebe the currentApp folder is the root folder of your application. When updating the app it is expected that all source files and folder will be updated respectively. To store an information that will not be deleted on source update you can use documents folder and even create your own subfolder. It can still be manually deleted from the user but it won't be deleted when you are updating the application source.

Thanks for this advice!

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hshristov picture hshristov  路  3Comments

Pourya8366 picture Pourya8366  路  3Comments

tsonevn picture tsonevn  路  3Comments

yclau picture yclau  路  3Comments

valentinstoychev picture valentinstoychev  路  3Comments