question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with installing cordova plugins using ionic cordova add plugin

See original GitHub issue

Description: Unable to install cordova plugins using ionic cordova add plugin. I get the errors for every plugin I try to install this way.

Steps to Reproduce: Install a plugin using ionic cordova add plugin. I have tried this thousands of times, tried upgrading to the latest cordova, but nothing help, unless I install the plugins using cordova add plugin

Output:

Error: Text data outside of root node.
Line: 178
Column: 1
Char: n
    at error (/Users/jacques/dev/mobile/node_modules/elementtree/node_modules/sax/lib/sax.js:666:10)
    at strictFail (/Users/jacques/dev/mobile/node_modules/elementtree/node_modules/sax/lib/sax.js:692:7)
    at Object.write (/Users/jacques/dev/mobile/node_modules/elementtree/node_modules/sax/lib/sax.js:1035:15)
    at XMLParser.feed (/Users/jacques/dev/mobile/node_modules/elementtree/lib/parsers/sax.js:48:15)
    at ElementTree.parse (/Users/jacques/dev/mobile/node_modules/elementtree/lib/elementtree.js:271:10)
    at Object.parse (/Users/jacques/dev/mobile/node_modules/elementtree/lib/elementtree.js:584:8)
    at Function.<anonymous> (/Users/jacques/dev/mobile/node_modules/@ionic/cli-utils/lib/cordova/config.js:35:28)
    at next (native)
    at fulfilled (/Users/jacques/dev/mobile/node_modules/tslib/tslib.js:100:62)

My ionic info:

cli packages: (/Users/jacques/dev/mobile/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 6.5.0 
    Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

    Cordova Platforms : none
    Ionic Framework   : ionic1 1.3.5

System:

    ios-deploy : 1.9.2 
    Node       : v6.11.0
    npm        : 2.15.12 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.1 Build version 9B55 

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
jacquesdevcommented, Apr 19, 2018

Check your config.xml file, usually the end of it - you will probably see a xml node starting with />.

You should just be able to delete the weird bit of code at the end and try again

0reactions
Sagar-rrcommented, Dec 10, 2019

Since Last Two Days I am trying to install cordova-plugin-firebase-dynamiclinks but i am getting folowing I have search on google for error but I am not getting any solution and I am not able to understand why this error is comming. Please help
I get this error:

D:\Apps\myapp>ionic cordova platform add android

cordova.cmd platform add android Using cordova-fetch for cordova-android@^8.0.0 Adding android project… Creating Cordova project for the Android platform: Path: platforms\android Package: com.myapp.application Name: MyApp Activity: MainActivity Android target: android-28 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@8.1.0 Installing “cordova-plugin-android-permissions” for android Installing “cordova-plugin-androidx” for android Installing “cordova-plugin-androidx-adapter” for android Installing “cordova-plugin-contacts” for android Installing “cordova-plugin-device” for android Installing “cordova-plugin-firebase-dynamiclinks” for android Plugin dependency “cordova-support-android-plugin@1.0.1” already fetched, using that version. Installing “cordova-support-android-plugin” for android Plugin dependency “cordova-support-google-services@1.3.2” already fetched, usin that version. Installing “cordova-support-google-services” for android Subproject Path: CordovaLib Subproject Path: app Failed to install ‘cordova-plugin-firebase-dynamiclinks’: Error: Invalid charac er in entity name Line: 0 Column: 283 Char: = at error (D:\Apps\myapp\node_modules\elementtree\node_modules\sax\lib
ax.js:666:10) at strictFail (D:\Apps\myapp\node_modules\elementtree\node_modules\sax lib\sax.js:692:7) at SAXParser.write (D:\Apps\myapp\node_modules\elementtree\node_module \sax\lib\sax.js:1491:13) at XMLParser.feed (D:\Apps\myapp\node_modules\elementtree\lib\parsers
ax.js:48:15) at ElementTree.parse (D:\Apps\myapp\node_modules\elementtree\lib\eleme ttree.js:271:10) at Object.exports.XML (D:\Apps\myapp\node_modules\elementtree\lib\elem nttree.js:606:13) at ConfigFile_graft_child [as graft_child] (D:\Apps\myapp\node_modules cordova-common\src\ConfigChanges\ConfigFile.js:107:40) at PlatformMunger_apply_file_munge [as apply_file_munge] (D:\Apps\myapp \node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:81:34) at munge_helper (D:\Apps\myapp\node_modules\cordova-common\src\ConfigC anges\ConfigChanges.js:252:14) Invalid character in entity name Line: 0 Column: 283 Char: = at PlatformMunger.add_plugin_changes (D:\Apps\myapp\node_modules\cordo a-common\src\ConfigChanges\ConfigChanges.js:159:12) [ERROR] An error occurred while running subprocess cordova.

    cordova.cmd platform add android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more
    information.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Cordova Plugins and Ionic Native - Capacitor
Installing Cordova Plugins ​. Simply install your plugin of choice, sync your project, finish any required native project configuration, and you're ready to ......
Read more >
Install Ionic Cordova Plugin to Manage Updates and Plugin List
Install the Ionic Cordova plugin to manage your list of Cordova plugins and all inputs, updates, and more. Read to learn more about...
Read more >
Ionic/Cordova: How to install plugin into existing project?
Did you include cordova.js to your project? If you have, you should create a new issue for this as its not really related...
Read more >
Blog - Apache Cordova
cordova plugin remove cordova-plugin-media cordova plugin add ... All plugins that continue to use the Android Support Library will need to ...
Read more >
How to install & use Cordova Native Plugin in Ionic 3, 4
Ionic accesses the native functionality of the platforms through Cordova plugins and in order to access Cordova plugin Ionic has provided a list...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found