Corodva插件 升级
Cordova插件可以 修改后 需要重新提交到相应的Cordova项目中。
如果 直接删除 再次重新安装 有时重新安装时就会有这样那样的错误 安装失败。
解决方法
1.安装某个插件后 Cordova项目根目录 config.xml 文件 内容
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.dchealth.patient.XinSui" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>AA</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="android" spec="^6.2.3" />
<!-- 以下两行就是相应插件在config.xml文件中的配置 -->
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="org.apache.cordova.XXXXXXX"spec="D:\Cordova\CDSP\Plugin\0906\XXXXXXX" />
</widget>
2.安装某个插件后 Cordova项目根目录 package.json 文件 内容
{
"name": "com.dchealth.patient.xinsui",
"displayName": "AA",
"version": "1.0.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"dependencies": {
<!-- 插件在package.json 文件中的相关配置 -->
"XXXXXXX": "file:///D:\\Cordova\\CDSP\\Plugin\\0906\\XXXXXXX",
"cordova-android": "^6.2.3",
"cordova-plugin-whitelist": "^1.3.2",
"org.apache.cordova.XXXXXXX": "D:\\Cordova\\CDSP\\Plugin\\0906\\XXXXXXX"
},
"cordova": {
"plugins": {
<!-- 插件在package.json 文件中的相关配置 -->
"cordova-plugin-whitelist": {},
"org.apache.cordova.XXXXXXX": {}
},
"platforms": [
"android"
]
}
}
现在将XXXXXXX插件卸载
3.卸载相应插件后Cordova项目根目录 config.xml 文件 内容
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.dchealth.patient.XinSui" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>AA</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="android" spec="^6.2.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
</widget>
4.卸载相应插件后Cordova项目根目录 package.json 文件 内容
{
"name": "com.dchealth.patient.xinsui",
"displayName": "AA",
"version": "1.0.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"dependencies": {
<!-- 此文件中还有相应的插件配置 应该手动删除 -->
"XXXXXXX": "file:///D:\\Cordova\\CDSP\\Plugin\\0906\\XXXXXXX",
"cordova-android": "^6.2.3",
"cordova-plugin-whitelist": "^1.3.2"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {}
},
"platforms": [
"android"
]
}
}