# ENOENT: no such file or directory, open 'platforms/android/AndroidManifest.xml'

**URL:** <https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579>\
**Category:** ionic-v3\
**Created:** [March 6, 2018, 10:27am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579 "2018-03-06T10:27:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dlazzy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dlazzy/32/113503_2.png) [@Dlazzy](https://forum.ionicframework.com/u/Dlazzy)\
**Post date:** [March 6, 2018, 10:27am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/1 "2018-03-06T10:27:34Z")

</div>

Hello,

I’ve just reinstalled Ubuntu 16.04 lts, so I installed Android SDK, Node, NPM…  
There is my `ionic info` output :

```auto
cli packages: (/home/dlazzy/.nvm/versions/node/v7.8.0/lib/node_modules)

    @ionic/cli-utils : 1.10.2
    ionic (Ionic CLI) : 3.10.3

global packages:

    Cordova CLI : 7.0.1 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms : android 7.1.0
    Ionic Framework : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node : v7.8.0
    npm : 5.7.1 
    OS : Linux 4.13

```

So I cloned my aleady started Ionic project, then I do `npm install && ionic cordova build android`, there was no problem with `npm install`, but when building for Android, I have this error :

```auto
Error: Uh oh!
ENOENT: no such file or directory, open '/home/dlazzy/project_dir/platforms/android/AndroidManifest.xml'

```

So I can’t build anymore for Android… Before resetting my computer I already have node@7.8.0, codova@7.0.1 and ionic@3.10.3 and there was no problem ☹  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![vibinflogesoft](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vibinflogesoft/32/117525_2.png) [@vibinflogesoft](https://forum.ionicframework.com/u/vibinflogesoft)\
**Post date:** [March 6, 2018, 10:42am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/2 "2018-03-06T10:42:33Z")

</div>

Hey@Dlazzy  
Try this it may help you

```auto
ionic cordova platform add android

```

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [March 6, 2018, 10:57am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/3 "2018-03-06T10:57:24Z")

</div>

Try to remove and add your platform. With the introdction of cordova 7 the file structure of the Android platform did change

```
ionic cordova platform rm android --save
ionic cordova platform add android@latest --save

```

[http://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html](http://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html)

You did clone your project, so maybe on the source project you were using cordova-android \< 7

---

<div class="post-metadata">

**Author:** ![Dlazzy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dlazzy/32/113503_2.png) [@Dlazzy](https://forum.ionicframework.com/u/Dlazzy)\
**Post date:** [March 6, 2018, 11:00am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/4 "2018-03-06T11:00:06Z")

</div>

Hello,

My project have `<engine name="android" spec="^7.0.0" />` in config.xml currently on the repository.  
Also `"cordova-android": "^7.1.0"` in package.json.  
I will try what you say by removing and adding latest android platform thanks.

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [March 6, 2018, 11:01am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/5 "2018-03-06T11:01:13Z")

</div>

I doesn’t work, you could try to use cordova-android@6.4.0 just to check if it’s the problem

Or maybe update the plugins in order to be compatible with 7.1.0

---

<div class="post-metadata">

**Author:** ![Dlazzy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dlazzy/32/113503_2.png) [@Dlazzy](https://forum.ionicframework.com/u/Dlazzy)\
**Post date:** [March 6, 2018, 11:08am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/6 "2018-03-06T11:08:40Z")

</div>

It worked !  
This is what I do :

- Installed node@7.8.0, ionic@3.12.0 and cordova@7.0.1.
- Removed the project folder
- Cloned again
- Directly in package.json set `"cordova-android": "6.4.0"`
- Then `npm install && ionic cordova build android` and it works !

Also `ionic cordova run android --prod` works.

Thank you very much @reedrichards and @vibinflogesoft

---

<div class="post-metadata">

**Author:** ![rodrigoarj](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rodrigoarj/32/128393_2.png) [@rodrigoarj](https://forum.ionicframework.com/u/rodrigoarj)\
**Post date:** [September 21, 2019, 2:32am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/7 "2019-09-21T02:32:41Z")

</div>

I found one solution without downgrade cordova-android. What I did:

- Added `<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" />` in config.xml, in plugins/plugin.xml (inside platform android tag) and in all plugin.xml(inside platform android tag too) of all plugins installed.

- And I changed  
`var manifestPath = path.join(ctx.opts.projectRoot, 'platforms/android/AndroidManifest.xml');`  
to `var manifestPath = path.join(ctx.opts.projectRoot, 'platforms/android/app/src/main/AndroidManifest.xml');`  
in plugins/updateMultidexManifest.js

---

<div class="post-metadata">

**Author:** ![achakra21](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/achakra21/32/137725_2.png) [@achakra21](https://forum.ionicframework.com/u/achakra21)\
**Post date:** [August 29, 2020, 5:11am UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/8 "2020-08-29T05:11:19Z")

</div>

It seems the project is missing `cordova.js` on platforms folder & while building it missing some important files , So you can run below commands for respective platforms.

> Android

```auto
ionic cordova platform rm android --save
ionic cordova platform add android --save

```

> iOS

```auto
ionic cordova platform rm ios --save
ionic cordova platform add ios --save

```

It should work.

---

<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, 8:54pm UTC](https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-open-platforms-android-androidmanifest-xml/123579/9 "2021-07-19T20:54:13Z")

</div>

Closed on July 19, 2021, 8:54pm UTC


