Search code examples
androidgitcordovaplugins

Error generating app - "Malformed Comment"


When generating an android app with a plugin I developed, I obtain the following error:


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

Does anyone have an idea of where is the error from? I've checked every file for an uncommented line but there were none.


Solution

  • You have a "start comment" inside another comment section in plugin.xml, on line 97, where it says WikitudePlugin Source:

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

    In future, you could run any xml validator against your plugin.xml, and it would have told you so (as did sax.js in your error report, it was just one line off).