# Cannot load empty config.xml file (Android build)

**URL:** <https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461>\
**Category:** ionic-v3\
**Created:** [January 25, 2018, 11:42pm UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461 "2018-01-25T23:42:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![cherry](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/cherry/32/149370_2.png) [@cherry](https://forum.ionicframework.com/u/cherry)\
**Post date:** [January 25, 2018, 11:42pm UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/1 "2018-01-25T23:42:54Z")

</div>

Hello,

I am trying to run an application on my Android phone. The result of it is getting this error for following the command.

**ionic cordova run**

![2018-01-26 00_35_58-Program Manager](https://global.discourse-cdn.com/ionicframework/original/3X/4/d/4dca02abbfab0928a0ba813c48d1a9106bc4070f.jpg)

My Application’s **ionic info**.

 ![exe](https://global.discourse-cdn.com/ionicframework/original/3X/6/7/6765032653f834054f799577e00f373c985862c8.png)

Does someone has an answer for this problem ?

Thanks already 🙂.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [January 26, 2018, 12:37am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/2 "2018-01-26T00:37:18Z")

</div>

Is your `config.xml` empty?  
You app-scripts is super old, update to a current version.  
Run `npm uninstall ionic` to get rid of that local install.  
Also look for other local cli packages in package.json and run `npm install` after cleaning up.

---

<div class="post-metadata">

**Author:** ![cherry](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/cherry/32/149370_2.png) [@cherry](https://forum.ionicframework.com/u/cherry)\
**Post date:** [January 26, 2018, 2:08am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/3 "2018-01-26T02:08:00Z")

</div>

Yes config.xml is empty. I **fixed** this error now, Visual Studio caused the bug it deleted it overwrote something so the config.xml was empty then.

The **Warning** still appears of old versions. Should I maybe remove the whole **node\_modules** folder and do a clean `npm install` then again ?

I tried running the command again it prints out this error. I gues its because I still have the older version or am I wrong ?

![node error](https://global.discourse-cdn.com/ionicframework/original/3X/d/d/ddda1f238537f08ee791ce50c9361fd200781472.jpg)

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [January 26, 2018, 11:28am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/4 "2018-01-26T11:28:40Z")

</div>

Your app-scripts is super old.  
Your `ionic info` should list the platforms you have installed.

Try removing and re-adding the platforms.

Best try it with a new project with `ionic start` and see if you can get it running. If you can, make sure your project matches as close as possible.

---

<div class="post-metadata">

**Author:** ![SwapnilKate](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@SwapnilKate](https://forum.ionicframework.com/u/SwapnilKate)\
**Post date:** [February 22, 2018, 9:59am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/5 "2018-02-22T09:59:27Z")

</div>

Hi, I am also getting the same error of config.xml getting cleared whnever running ionic run -l -c.  
May I know the exact reason for this and how you solved it. It will be very useful.

Thanks.

---

<div class="post-metadata">

**Author:** ![cherry](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/cherry/32/149370_2.png) [@cherry](https://forum.ionicframework.com/u/cherry)\
**Post date:** [February 24, 2018, 5:20am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/6 "2018-02-24T05:20:16Z")

</div>

The problem was with my Visual Studio Branch. The config.xml file got overwritten if I remember right. But im still getting alot of errors after that small “fix”.

Im sorry I don’t have a solution for it 😕

---

<div class="post-metadata">

**Author:** ![SwapnilKate](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@SwapnilKate](https://forum.ionicframework.com/u/SwapnilKate)\
**Post date:** [February 24, 2018, 9:08am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/7 "2018-02-24T09:08:28Z")

</div>

Hey, thanks for the reply. Anyways will figure it out.

---

<div class="post-metadata">

**Author:** ![hajricod](https://avatars.discourse-cdn.com/v4/letter/h/edb3f5/32.png) [@hajricod](https://forum.ionicframework.com/u/hajricod)\
**Post date:** [July 30, 2018, 9:45am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/8 "2018-07-30T09:45:39Z")

</div>

**ionic integrations enable cordova --add**

I had same issue, config.xml got empty suddenly. Anyway, try the code i provided above and you will be asked to overwrite _resources folder_.

**DONT ACCEPT OVERWRITE**

choose no, then run your android. Overwriting your resources folder will lead to other issues.

---

<div class="post-metadata">

**Author:** ![sbangani](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sbangani](https://forum.ionicframework.com/u/sbangani)\
**Post date:** [September 13, 2018, 10:02am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/9 "2018-09-13T10:02:26Z")

</div>

Thanks it Worked for me.

---

<div class="post-metadata">

**Author:** ![Qbiqs0971](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/qbiqs0971/32/123691_2.png) [@Qbiqs0971](https://forum.ionicframework.com/u/Qbiqs0971)\
**Post date:** [October 25, 2018, 4:14pm UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/10 "2018-10-25T16:14:25Z")

</div>

thank you, it worked for me.

---

<div class="post-metadata">

**Author:** ![udayc](https://avatars.discourse-cdn.com/v4/letter/u/35a633/32.png) [@udayc](https://forum.ionicframework.com/u/udayc)\
**Post date:** [December 2, 2018, 5:41pm UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/11 "2018-12-02T17:41:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![WaseemAhmad098756](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@WaseemAhmad098756](https://forum.ionicframework.com/u/WaseemAhmad098756)\
**Post date:** [February 1, 2019, 8:33am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/12 "2019-02-01T08:33:44Z")

</div>

This answer by @udayc is correct but I recommend you to just overwrite the `config.xml` file only. Do not overwrite the `resource` file as it create more issues.

---

<div class="post-metadata">

**Author:** ![PRINCEPHUKON](https://avatars.discourse-cdn.com/v4/letter/p/6de8d8/32.png) [@PRINCEPHUKON](https://forum.ionicframework.com/u/PRINCEPHUKON)\
**Post date:** [April 23, 2019, 10:23am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/13 "2019-04-23T10:23:52Z")

</div>

May be your config.xml is zero for some reasons like PC shutdown or something else.  
So just write this code in cmd line

**ionic integrations enable cordova --add**

---

<div class="post-metadata">

**Author:** ![vivek-23](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vivek-23/32/125332_2.png) [@vivek-23](https://forum.ionicframework.com/u/vivek-23)\
**Post date:** [June 21, 2019, 7:29pm UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/14 "2019-06-21T19:29:08Z")

</div>

Thanks, worked for me too 🙂

---

<div class="post-metadata">

**Author:** ![alanhelmick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/alanhelmick/32/127561_2.png) [@alanhelmick](https://forum.ionicframework.com/u/alanhelmick)\
**Post date:** [August 6, 2019, 4:37pm UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/15 "2019-08-06T16:37:15Z")

</div>

Worked like a charm! I had to stop an initial add of the android platform due to a network issue with the shared cloud folder, the platform add would have been waiting days… when I CTRL+C it would not stop, had to terminate… blank ./config.xml THIS WORKED!

---

<div class="post-metadata">

**Author:** ![ketanambekar](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@ketanambekar](https://forum.ionicframework.com/u/ketanambekar)\
**Post date:** [September 3, 2019, 5:29am UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/16 "2019-09-03T05:29:14Z")

</div>

Yes you are Right!!  
After running this command **ionic integrations enable cordova --add**

_I Accepted overwrite_ and other issues occurred…  
Some what like this --\> Unexpected token in JSON at position 0

To solve this I removed the platform and added it again.  
Everything started working again… 🤩

Thanks very much 🥳

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:53pm UTC](https://forum.ionicframework.com/t/cannot-load-empty-config-xml-file-android-build/119461/17 "2021-07-19T21:53:10Z")

</div>

Closed on July 19, 2021, 9:53pm UTC


