Why i am getting this error?

When i run ionic platfrom add android i am getting this error…
Caught exception:
Error: Unencoded <
Line: 0
Column: 2
Char: <
at error (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\node_modules\sax\lib\sax.js:667:10)
at strictFail (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\node_modules\sax\lib\sax.js:693:7)
at Object.write (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\node_modules\sax\lib\sax.js:1093:13)
at Parser.exports.Parser.Parser.parseString (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\lib\xml2js.js:503:31)
at Parser.parseString (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\lib\xml2js.js:7:59)
at Object.exports.parseString (C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\xml2js\lib\xml2js.js:535:19)
at C:\Users\Mohammad Arsalan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\lib\config-xml.js:21:12
at tryToString (fs.js:455:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:442:12)

It seems to be an error in your config.xml


Thanks Problem Solved :slight_smile:

Hello Arsalan, can you please explain to me how did you fix this error? Thanks in advance :slight_smile:

Had this issue too. Turned out to be git commit conflict markup in the config.xml causing this error.


Yes weird!

But the problem may be because an open tag or lack of something about git merge

1 Like

This was the exact issue in my project as well, thanks buddy. :smiley:

i have this problem after git merge how can i solve this problem ,please?

Exactly. this is caused by git merge. You need to go to VSCode and open config.xml then resolve conflict