首页 > 解决方案 > 生成应用程序时出错 - “格式错误的评论”

问题描述

使用我开发的插件生成 android 应用程序时,出现以下错误:


No scripts found for hook "before_plugin_add".

Calling plugman.fetch on plugin "https://github.com/ruption-lda/ruption-ar-cordova-plugin.git"

 fetch: Installing https://github.com/ruption-lda/ruption-ar-cordova-plugin.git to /var/lib/builder/builds/0ef2e8ae-548b-48aa-ab11-225c2030063f/source

 Running command: npm install https://github.com/ruption-lda/ruption-ar-cordova-plugin.git --save-exact

 Command finished with error code 0: npm install,https://github.com/ruption-lda/ruption-ar-cordova-plugin.git,--save-exact

Error: Malformed comment

 Line: 96

 Column: 13

Char:  

     at error (/usr/lib/node_modules/cordova/node_modules/sax/lib/sax.js:666:10)

     at strictFail (/usr/lib/node_modules/cordova/node_modules/sax/lib/sax.js:692:7)

     at SAXParser.write (/usr/lib/node_modules/cordova/node_modules/sax/lib/sax.js:1195:13)

    at XMLParser.feed (/usr/lib/node_modules/cordova/node_modules/elementtree/lib/parsers/sax.js:48:15)

    at ElementTree.parse (/usr/lib/node_modules/cordova/node_modules/elementtree/lib/elementtree.js:271:10)

    at Object.parse (/usr/lib/node_modules/cordova/node_modules/elementtree/lib/elementtree.js:584:8)

    at parseElementtreeSync (/usr/lib/node_modules/cordova/node_modules/cordova-common/src/util/xml-helpers.js:127:19)

     at new PluginInfo (/usr/lib/node_modules/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfo.js:40:20)

     at PluginInfoProvider.get (/usr/lib/node_modules/cordova/node_modules/cordova-common/src/PluginInfo/PluginInfoProvider.js:35:36)

    at /usr/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:144:51

有谁知道错误来自哪里?我检查了每个文件中是否有未注释的行,但没有。

标签: androidgitcordovaplugins

解决方案


您在 plugin.xml 的另一个评论部分中的第 97 行有一个“开始评论”,其中显示 WikititudePlugin Source:

 <!-- iOS --> <!--
<platform name="ios">
            
            
    <!-- WikitudePlugin Source --

将来,您可以针对您的 plugin.xml 运行任何 xml 验证器,它会告诉您(就像您的错误报告中的 sax.js 一样,它只差一行)。


推荐阅读