13

I am getting a Cannot load empty config.xml file when I try to run ionic cordova run android. Has anyone ever encountered this problem before? ionic serve seems to work.

enter image description here

1
  • check your config.xml whether it is empty or not as well as check whether you have added the android or ios platform Commented Jan 14, 2018 at 13:13

6 Answers 6

32

Just use the below command it will work!

ionic integrations enable cordova --add

Sign up to request clarification or add additional context in comments.

2 Comments

This can cause another issue just copy your .code back if you have pushed it to github before.
true, I realized it later, it would be generated angular imports in ionic with umd, therefore be careful, If you cannot restore from git better to got with above solution and delete umd from imports in ts files.
17

This error is because your global config.xml file is empty for some reason. You should check config.xml file of your Ionic project, it's located in /your/project/path/config.xml and recover its last content.

7 Comments

This was the problem. Thanks
My config.xml has seemingly been randomly going blank. Anyone have a solution to this?
Do you use git in your project ?
If you use Git, you can use it to recover config.xml content.
I've got the same issue, each time I stop ionic cordova run android -l -c --device using ctrl+break (may reproduce with other commands)
|
8
ionic integrations enable cordova --add

This solution worked for me. But as I read other posted solutions. I recommend you not to overwrite the resource folder Do overwrite config.xml folder (because in my case this is root of issues).

Thanks and Love

Comments

0

I went to github copied the codes inside my config.xml on my previous push to github, paste it on my local config.xml and walahi it worked. Try this.

Comments

0

I also got into the same problem. Just delete the config.xml file and run this command to create a new one

ionic integrations enable cordova --add

This worked for me.

Comments

-2

That file might get randomly deleted, So take that file back,Working for me fine

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.