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="dev@cordova.apache.org" 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="dev@cordova.apache.org" 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"
        ]
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值