简体   繁体   中英

cordova build android removes older version

I have recently upgraded Cordoova to version 6 with android platforms 5.1.0 and ios 4.0.1 in one of the projects. After also upgrading all plugins to the latest version the app is finally working again as it should.

However, I have noticed one very annoying difference:

With the old version when I ran the command:

cordova build android

it was compiling the app and installing it on the phone. However, it kept all the "data" from the previous version. So for example localStorage or SQLite database remained available.

When I run the same command under the new version, it replaces the app, removing all of it's "data".

As the app has a "setup process" I will now need to complete this every time I deploy a new version to the phone for testing, which is quite time consuming.

Is there any settings available to change this behavior? I already checked the change log from Cordova but could not find any evidence what they have changed...

This issue was related to a bug in cordova, which got fixed with the latest release on March 2nd.

To fix it I did:

npm install -g cordova
cordova platform update android@5.1.1

details about the issue:

https://issues.apache.org/jira/browse/CB-10157

So in case you face a similar issue try to update your project - it worked just fine for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM