Cordova Unable to add plugins (not the usual errors!)

I can begin with saying I’ve followed the “How-to”-guide step by step several times…
I’ve spent a good 6+ hours on installing and reinstalling all the packages to get ionic to work.
I’ve also googled like crazy and found many solutions to similar problems but not a single one seems to work for me.

The following are my specifications and a description on all solutions “out there” and I still cant make it work.
I’m using Windows 7 Professional 64bit.

My projects’ config.xml is empty, is this because the project couldn’t be initialized correctly?

Please help me, I was really looking forward to start playing with this (hopefully) awsome framework.

Thanks alot in advance!

[IONIC]
C:\Users\Matte>ionic start test
Creating Ionic app in folder C:\Users\Matte\test based on tabs project

Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
[=============================]  100%  0.0s

Downloading: https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
[=============================]  100%  0.0s

Update config.xml
Initializing cordova project
Unable to add plugins. Perhaps your version of Cordova is too old. Try updating
(npm install -g cordova), removing this project folder, and trying again. (CLI v
1.2.8)
[VERSIONS]
C:\Users\Matte>cordova -version >> 4.0.0
C:\Users\Matte>ionic -version >> 1.2.8
C:\Users\Matte>git --version >> 1.9.4.msysgit.2
C:\Users\Matte>npm -version >> 1.4.28
[PATH]
PATH for git,ant,npm,java,androidSDK are confirmed working.
Also added folder "C:\Users\Matte\AppData\Local\Temp\plugman\git"
[CORDOVA]
C:\Users\Matte\test>cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
Parsing C:\Users\Matte\test\config.xml failed
Error: Unexpected end
Line: 0
Column: 0
Char:
    at error (C:\Users\Matte\AppData\Roaming\npm\node_modules\cordova\node_modul
es\cordova-lib\node_modules\elementtree\node_modules\sax\lib\sax.js:347:8)
    at end (C:\Users\Matte\AppData\Roaming\npm\node_modules\cordova\node_modules
\cordova-lib\node_modules\elementtree\node_modules\sax\lib\sax.js:354:32)
    at Object.write (C:\Users\Matte\AppData\Roaming\npm\node_modules\cordova\nod
e_modules\cordova-lib\node_modules\elementtree\node_modules\sax\lib\sax.js:588:3
0)
    at Object.SAXParser.close (C:\Users\Matte\AppData\Roaming\npm\node_modules\c
ordova\node_modules\cordova-lib\node_modules\elementtree\node_modules\sax\lib\sa
x.js:136:38)
    at XMLParser.close (C:\Users\Matte\AppData\Roaming\npm\node_modules\cordova\
node_modules\cordova-lib\node_modules\elementtree\lib\parsers\sax.js:52:15)
    at ElementTree.parse (C:\Users\Matte\AppData\Roaming\npm\node_modules\cordov
a\node_modules\cordova-lib\node_modules\elementtree\lib\elementtree.js:264:23)
    at Object.exports.XML (C:\Users\Matte\AppData\Roaming\npm\node_modules\cordo
va\node_modules\cordova-lib\node_modules\elementtree\lib\elementtree.js:593:13)
    at Object.module.exports.parseElementtreeSync (C:\Users\Matte\AppData\Roamin
g\npm\node_modules\cordova\node_modules\cordova-lib\src\util\xml-helpers.js:126:
38)
    at Object.ConfigParser (C:\Users\Matte\AppData\Roaming\npm\node_modules\cord
ova\node_modules\cordova-lib\src\configparser\ConfigParser.js:45:24)
    at getScriptsFromConfigXml (C:\Users\Matte\AppData\Roaming\npm\node_modules\
cordova\node_modules\cordova-lib\src\hooks\scriptsFinder.js:110:21)
[IONIC]
C:\Users\Matte\test>ionic platform add android
Error updating C:\Users\Matte\test\config.xml: TypeError: Cannot read property '
widget' of null (CLI v1.2.8)
[ANT]
C:\Users\Matte>ant
Buildfile: build.xml does not exist!
Build failed

I’m pretty sure I’ve looked throught the entire web for the solution of this problem and it is really frustrating.

The problem probably starts with the Ionic start command not working fully when Cordova tries to install plugins (and appears to be clearing the config.xml file in the process). Trying to run Cordova commands in a project without a valid config.xml file will fail.

Try putting the config.xml file back into your project from the base https://github.com/driftyco/ionic-app-base/blob/master/config.xml and then try to manually install Cordova plugins. If they continue to fail, you could try to downgrade Cordova to the 3.5.x version and see if that helps.

run the command android list target. If you see:

‘xcopy’ is not recognized as an internal or external command,
operable program or batch file.
at the beginning of the command output, it means you will need to fix your Windows Path variable to include xcopy. This location is typically under C:\Windows\System32.

The link: http://adilapapaya.com/docs/cordova/

Please try to add this:

Set Environment variable PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

Thanks both of you!
What solved my problem was manually adding the contents in the zip-archives to my projectfolder, however, since today (2 days after I started this) the archives are successfully downloaded and extracted automatically, so I’m suspecting the zip-archive to have been damaged, or similar.

Hi @mattemarklund
I have the same problem,
could you please tell me which files and where should I put them?.

Thanks.