Nikola
Nikola

Reputation: 15038

Unencoded < char error after running ionic cordova prepare ios

I'm updating my old Ionic 1 project which was actually working 2 months ago.

The error that I'm getting after running ionic cordova prepare ios is:

Error: Unencoded <
Line: 1
Column: 2
Char: <
    at error (/Users/nikola/DEV/myFirstIonicProject/node_modules/elementtree/node_modules/sax/lib/sax.js:666:10)
    at strictFail (/Users/nikola/DEV/myFirstIonicProject/node_modules/elementtree/node_modules/sax/lib/sax.js:692:7)
    at SAXParser.write (/Users/nikola/DEV/myFirstIonicProject/node_modules/elementtree/node_modules/sax/lib/sax.js:1080:13)
    at XMLParser.feed (/Users/nikola/DEV/myFirstIonicProject/node_modules/elementtree/lib/parsers/sax.js:48:15)
    at ElementTree.parse (/Users/nikola/DEV/myFirstIonicProject/node_modules/elementtree/lib/elementtree.js:271:10)
    at Object.parse (/Users/nikola/DEV/myFirstIonicProject/node_modules/elementtree/lib/elementtree.js:584:8)
    at Function.<anonymous> (/Users/nikola/DEV/myFirstIonicProject/node_modules/ionic/node_modules/@ionic/cli-utils/lib/cordova/config.js:35:28)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/nikola/DEV/myFirstIonicProject/node_modules/ionic/node_modules/tslib/tslib.js:104:62)
    at <anonymous>

Any ideas or tips?

Upvotes: 0

Views: 393

Answers (1)

Nikola
Nikola

Reputation: 15038

This is one of those 'Ionic 1 moments' where the solution was not in the error message but in taking a close look at config.xml file and making sure there are no extra characters there.

In my case, I had an extra line at the end of the file. Why this was throwing the build off, I'm not sure.

Either way, hope this helps someone. This official thread was also useful for nailing down this 'bug'.

Upvotes: 1

Related Questions