问题描述
我最近在其中一个项目中将Cordoova升级到版本6,安装了Android平台5.1.0和ios 4.0.1。
在将所有插件升级到最新版本后,应用程序最终会重新正常工作。
但是,我注意到一个非常讨厌的区别: p>
使用旧版本时,我执行命令:
cordova build android
它正在编译应用程序并将其安装在手机上。然而,它保留了所有的数据从以前的版本。因此,例如localStorage或SQLite数据库仍然可用。
当我在新版本下运行相同的命令,它替换了应用程序,删除它的所有数据。 / p>
由于应用程序具有设置过程,我现在需要在每次部署新版本到手机进行测试时完成此操作,这是非常耗时的。 / p>
是否有任何设置可以更改此行为?
我已经检查了Cordova的更改日志,但找不到任何证据他们改变了...
此问题与cordova上的错误有关,该问题已于3月2日更新为最新版本。
为了解决这个问题,我做了:
npm install -g cordova
cordova平台更新[email protected]
有关此问题的详情:
因此,你面临类似的问题,尝试更新你的项目 - 它的工作对我很好。
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 [email protected]
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.
这篇关于cordova构建安卓删除旧版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!