【问题标题】:Ionic 2: cordova run android Error (Unmatched closing tag)Ionic 2:cordova 运行 android 错误(不匹配的结束标签)
【发布时间】:2016-06-28 21:11:24
【问题描述】:

当我运行cordova run android 时,我看到以下错误:

Failed to install 'ionic-plugin-keyboard':Error: Unmatched closing tag: widget
Line: 37
Column: 9
Char: >
    at error (/platforms/android/cordova/node_modules/sax/lib/sax.js:347:8)
    at strictFail (/platforms/android/cordova/node_modules/sax/lib/sax.js:364:22)
    at closeTag (/platforms/android/cordova/node_modules/sax/lib/sax.js:529:5)
    at Object.write (/platforms/android/cordova/node_modules/sax/lib/sax.js:948:29)
    at XMLParser.feed (/platforms/android/cordova/node_modules/elementtree/lib/parsers/sax.js:48:15)
    at ElementTree.parse (/platforms/android/cordova/node_modules/elementtree/lib/elementtree.js:271:10)
    at Object.exports.XML (/platforms/android/cordova/node_modules/elementtree/lib/elementtree.js:606:13)
    at Object.module.exports.parseElementtreeSync (/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:123:38)
    at ConfigFile_load [as load] (/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:70:33)
    at new ConfigFile (/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:47:10)

是否有关于在哪里查找错误的线索?我检查了 config.xml - 看起来不错。

【问题讨论】:

  • 您查看第 37 行第 9 列了吗?那里有没有与开始标签不匹配的</widget> 结束标签?
  • 在哪个文件中? config.xml 只有 34 行长...并且有一个 </widget> 结束标记!
  • 该错误并不是在抱怨缺少</widget> 标签——它是说有类似<foo><bar></bar></widget> 的东西——其中结束标签与开始标签不匹配。但是,如果行号不匹配,则可能是另一个文件(我不知道要检查其他什么文件,抱歉)
  • 我明白了!我会尝试对整个插件进行搜索 - 其他插件安装得很好!无论如何,谢谢 - 至少我有更好的理解!这似乎是插件的问题..

标签: android angularjs cordova angular ionic2


【解决方案1】:

所以我现在用最新的 ionic2 cli 删除并重新创建了项目,它似乎可以工作。我现在只有一个错误抱怨config.xml,这可以通过删除</widget>之后的空格来解决

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-16
    • 2012-09-29
    • 2018-04-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多