【问题标题】:Add local notification plugin to Visual Studio Cordova将本地通知插件添加到 Visual Studio Cordova
【发布时间】:2015-10-05 17:33:53
【问题描述】:

当我尝试添加本地通知插件时 (https://github.com/katzer/cordova-plugin-local-notifications) 在我的 Visual Studio Cordova 项目中,我收到了这条错误消息 -

Visual Studio 无法解析 plugin.xml。请确保 plugin.xml 存在且不包含错误。

我应该怎么做才能安装这个插件?谢谢!

【问题讨论】:

    标签: xml-parsing ionic-framework cordova-plugins visual-studio-cordova cordova-plugin-file


    【解决方案1】:

    plugin.xml 或 VS2015 似乎有问题。插件<engines 使用“模糊”匹配,它应该根据http://cordova.apache.org/docs/en/5.1.1/plugin_ref/spec.html 工作

        <engines>
        <engine name="cordova" version=">=3.6.0" />
        <engine name="cordova" version="<4.0.0" />
    </engines>
    

    不幸的是,&lt;engine name="cordova" version="&lt;4.0.0" /&gt; 元素阻止 VS2015 使用 config.xml > Plugins > Custom 加载插件

    临时修复:

    1. 将插件本地下载到项目plugins文件夹中
    2. cordova-plugin-local-notifications.plugin.xml 中删除&lt;engine name="cordova" version="&lt;4.0.0" /&gt;
    3. 使用config.xml Plugins > Custom > Local 检索插件

    【讨论】:

    • 感谢您的回复,我可以按照您的解决方案添加插件,但是当我构建时,输出中出现以下错误,1> 安装“de.appplant.cordova.plugin. local-notification" for android 1> 运行命令:C:\app\Kaobei\10052015\Shhh...ItWorks_\Shhh...ItWorks\platforms\android\cordova\version.bat 1> 命令完成,错误代码为 0: C:\app\...\platforms\android\cordova\version.bat1> 检测到依赖,遍历它们... 1> 已使用该版本获取依赖插件“cordova-plugin-device”。
    • 续 : 1> 依赖插件“cordova-plugin-device”已经安装在 android 上。 1> 未获取依赖插件“cordova-plugin-android-support-v4”,检索然后安装。 1> 通过插件注册表获取插件“cordova-plugin-android-support-v4” ========== 构建:0 成功,1 失败,0 最新,0 跳过 ===== =====
    猜你喜欢
    • 1970-01-01
    • 2014-08-24
    • 2017-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-23
    • 2016-06-26
    相关资源
    最近更新 更多