Error occurring during build android command execution


#1

while trying to build for platform android

[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
Error: Invalid character in entity name
Line: 4
Column: 64
Char: 

package.json

{
    "name": "biznet-mobile-app",
    "version": "0.0.1",
    "author": "Mujtaba Nowshad & EON InfoSys Team.",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@ionic-native/core": "3.10.2",
        "@ionic-native/http": "^3.12.1",
        "@ionic-native/splash-screen": "3.10.2",
        "@ionic-native/status-bar": "3.10.2",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
        "cordova-plugin-compat": "^1.1.0",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-file": "^4.3.3",
        "cordova-plugin-http": "^1.2.0",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "ionic-angular": "3.4.2",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.12"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "@ionic/cli-plugin-cordova": "1.4.0",
        "@ionic/cli-plugin-ionic-angular": "1.3.1",
        "typescript": "2.3.3"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-http": {},
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {}
        },
        "platforms": [
            "android"
        ]
    }
}

ionic info:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.4.2

System:

    Node       : v6.9.4
    OS         : Linux 4.2
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 4.1.1 


#2
  • What exact command are you running to build?
  • What is the output of the same command with --verbose at the end?
  • Can you post your config.xml please?

#3
  • running ionic cordova build android or ionic cordova run android
  • this is the --verbose output;
mnowshad@MNowshad-Workbench:~/Dev/cordova-projects/biznet-mobile-app$ ionic cordova build android --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] Getting plugin info for ionic
[DEBUG] Getting plugin info for @ionic/cli-plugin-cordova
[DEBUG] Getting plugin info for @ionic/cli-plugin-ionic-angular
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-cordova@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-ionic-angular@latest.
[DEBUG] Latest version of ionic@latest is 3.4.0.
[DEBUG] Latest version of @ionic/cli-plugin-ionic-angular@latest is 1.3.1.
[DEBUG] Latest version of @ionic/cli-plugin-cordova@latest is 1.4.0.
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Invalid character in entity name
Line: 4
Column: 91
Char:  
[DEBUG] Error: Invalid character in entity name
        Line: 4
        Column: 91
        Char:
        at error (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/sax/lib/sax.js:667:10)
        at strictFail (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/sax/lib/sax.js:693:7)
        at Object.write (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/sax/lib/sax.js:1507:13)
        at Parser.exports.Parser.Parser.parseString
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:508:31)
        at Parser.parseString
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:7:59)
        at exports.parseString
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:540:19)
        at Promise
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/@ionic/cli-utils/dist/lib/utils/promise.js:6:13)
        at
        /home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/@ionic/cli-utils/dist/lib/utils/promise.js:5:16
        at
        /home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/@ionic/cli-plugin-cordova/dist/lib/utils/configXmlUtils.js:108:32
        at next (native)
  • config.xml;
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name> Biznet App </name>
    <description> Biznet Mobile Application. </description>
    <author email="m.nowshad@eongroup.net.bd" href="http://www.eongroup.net.bd/"> Mujtaba Nowshad & EON InfoSys Team. </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="http://ionic.local/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
    </platform>
    <engine name="android" spec="^6.2.3" />
    <plugin name="cordova-plugin-console" spec="^1.0.5" />
    <plugin name="cordova-plugin-device" spec="^1.1.4" />
    <plugin name="cordova-plugin-http" spec="^1.2.0" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
</widget>

#4

First step is to install this.


#5
  • okay. installed @ionic/cli-plugin-proxy using npm i @ionic/cli-plugin-proxy --save-dev
  • ran command ionic cordova build android --verbose again;
mnowshad@MNowshad-Workbench:~/Dev/cordova-projects/biznet-mobile-app$ ionic cordova build android --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Invalid character in entity name
Line: 4
Column: 100
Char:  
[DEBUG] Error: Invalid character in entity name
        Line: 4
        Column: 100
        Char:
        at error (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/sax/lib/sax.js:667:10)
        at strictFail (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/sax/lib/sax.js:693:7)
        at Object.write (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/sax/lib/sax.js:1507:13)
        at Parser.exports.Parser.Parser.parseString
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:508:31)
        at Parser.parseString
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:7:59)
        at exports.parseString
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:540:19)
        at Promise
        (/home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/@ionic/cli-utils/dist/lib/utils/promise.js:6:13)
        at
        /home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/@ionic/cli-utils/dist/lib/utils/promise.js:5:16
        at
        /home/mnowshad/Dev/cordova-projects/biznet-mobile-app/node_modules/@ionic/cli-plugin-cordova/dist/lib/utils/configXmlUtils.js:108:32
        at next (native)

mnowshad@MNowshad-Workbench:~/Dev/cordova-projects/biznet-mobile-app$

#6

It’s asking you to install it globally…


#7
  • after installing globally, issue persisting;
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Invalid character in entity name
Line: 4
Column: 100
Char:  
[DEBUG] Error: Invalid character in entity name
        Line: 4
        Column: 100
        Char:
        at error (/home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/sax/lib/sax.js:667:10)
        at strictFail (/home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/sax/lib/sax.js:693:7)
        at Object.write
        (/home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/sax/lib/sax.js:1507:13)
        at Parser.exports.Parser.Parser.parseString
        (/home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:508:31)
        at Parser.parseString
        (/home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:7:59)
        at exports.parseString
        (/home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/xml2js/lib/xml2js.js:540:19)
        at Promise
        (/home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/@ionic/cli-utils/dist/lib/utils/promise.js:6:13)
        at
        /home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/@ionic/cli-utils/dist/lib/utils/promise.js:5:16
        at
        /home/mnowshad/Dev/cordova-projects/rat-test/biznet-mobile-app/node_modules/@ionic/cli-plugin-cordova/dist/lib/utils/configXmlUtils.js:108:32
        at next (native)

#8

You might need an Angular 2 wrapper for that sax library. Have you compiled it successfully with an Ionic or Angular project before?


#9

It was being served & built properly before I started including few promise & observable based code. could that possibly cause an issue?


#10

I find your posts really hard to understand. Are you saying you successfully built it for Android before? Or is this the first time you ever tried to build for the Android platform?


#11

This project was successfully build on android multiple times before.


#12

Something isn’t making sense. You’re saying you executed the same command line command multiple times, and never had an issue with the cli-proxy plugin before, and then you added a few lines of code with Promises in them, and your cli-proxy plugin uninstalled itself?


#13

If the issue was with cli-proxy, wouldn’t it run properly after it was installed globally?


#14

Actually no really, the DEBUG message here is a bit misleading: This plugin doesn’t have to be installed at all if you are not using a proxy.


#15

Try in this order:

  1. Get rid of the & in author
  2. Get rid of spaces in beginning and end of strings

I think it is 1)


#16

Thanks alot, the & was causing the issue!


#17

I had no idea this community was so well kept.
Kudos.
Why did the “&” break the code? Does ampersand mean anything inside html in angular ?

… am still half way through angular.


#18

In HTML & is & in general, but in this XML, not HTML, case Cordova which is working with this data somehow doesn’t like it. (Not related to Angular in any way)