Search code examples
macoscordovacordova-cli

Cordova CLI on OSX


When I am trying to build the iOS version of our app on OSX (10.9), I am getting the following error. I have updated, uninstalled and reinstalled cordova with no success.

I have also looked for the error to see if anyone has come across it before with no luck. Does anyone have any idea at what could be causing the issue?

$ cordova build ios
Error: Unencoded <
Line: 0
Column: 2
Char: <
    at error (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/node_modules/sax/lib/sax.js:347:8)
    at strictFail (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/node_modules/sax/lib/sax.js:364:22)
    at Object.write (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/node_modules/sax/lib/sax.js:671:11)
    at XMLParser.feed (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/lib/parsers/sax.js:48:15)
    at ElementTree.parse (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/lib/elementtree.js:263:10)
    at Object.exports.XML (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/lib/elementtree.js:593:13)
    at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/xml-helpers.js:126:38)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:88:31
    at Array.forEach (native)
    at Object.handlePrepare (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/prepare.js:81:24)

Solution

  • This error triggered by broken plugin.xml file for one of the plugins which you are using. Make sure that all such files are valid XML documents. Such files could be found in the plugins folder of your Cordova project root.