# Not able to add platform after upgrading to ionic 3

**URL:** <https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486>\
**Category:** ionic-v3\
**Created:** [June 8, 2017, 1:30pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486 "2017-06-08T13:30:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 8, 2017, 1:30pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/1 "2017-06-08T13:30:34Z")

</div>

I am not able to add platform after upgrading to ionic 3.

global packages:

```
@ionic/cli-utils : 1.3.0
Cordova CLI : 7.0.1 
Ionic CLI : 3.3.0

```

local packages:

```
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.3.0

```

System:

```
Node : v6.10.3
OS : macOS Sierra
Xcode : Xcode 8.3.1 Build version 8E1000a 
ios-deploy : not installed
ios-sim : 5.0.13 

```

I am getting this error every time

parthas-MacBook-Pro:App parthpratim$ ionic cordova platform add android

> cordova platform add android --save  
> ✖ Running command - failed!

[ERROR] Cordova encountered an error.  
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova platform add android --save (exit code 1):

```
    Using cordova-fetch for cordova-android@^6.2.3
   Error: Platform android already added.

```

**i Have tried the below too**  
parthas-MacBook-Pro:App parthpratim$ cordova platform add android  
Using cordova-fetch for cordova-android@^6.2.3  
Error: Platform android already added.  
parthas-MacBook-Pro:App parthpratim$ cordova run android  
Error: Source path does not exist: resources/android/icon/drawable-hdpi-icon.png

---

<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:** [June 8, 2017, 1:37pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/2 "2017-06-08T13:37:13Z")

</div>

Why do you want to add the platform again?

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 8, 2017, 1:44pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/3 "2017-06-08T13:44:03Z")

</div>

Accually its not added, there is no platform folder, when i ran “cordova run android” it is asking me to add platform.

---

<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:** [June 8, 2017, 1:47pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/4 "2017-06-08T13:47:01Z")

</div>

Really?  
I thought it was ok since the msg says the platform is there

```
 Using cordova-fetch for cordova-android@^6.2.3
 Error: Platform android already added.

```

Maybe trying to remove it and add it again?

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

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 8, 2017, 1:55pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/5 "2017-06-08T13:55:33Z")

</div>

> [@reedrichards](#):
>
> ionic cordova platform add android@latest --save

yes ☹ also i cant see the platform folder like my old ionic 2 app.

Let me try your given command, will get back to you

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 8, 2017, 2:00pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/6 "2017-06-08T14:00:44Z")

</div>

parthas-MacBook-Pro:App parthpratim$ ionic cordova platform rm android --save

> cordova platform remove android --save  
> ✔ Running command - done!  
> Removing platform android from config.xml file…  
> parthas-MacBook-Pro:App parthpratim$ ionic cordova platform add android@latest --save  
> cordova platform add android@latest --save  
> ✖ Running command - failed!

[ERROR] Cordova encountered an error.  
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova platform add android@latest --save (exit code 1):

```
    Using cordova-fetch for cordova-android@latest
    Adding android project...
    Creating Cordova project for the Android platform:
    	Path: platforms/android
    	Package: com.ionicframework.trapapp152823
    	Name: TrapApp
    	Activity: MainActivity
    	Android target: android-25
    Subproject Path: CordovaLib
    Android project created with cordova-android@6.2.3
    Error: Source path does not exist: resources/android/icon/drawable-hdpi-icon.png

```

This is strange, Package and name are showing the old app  
Package: com.ionicframework.trapapp152823  
Name: TrapApp

---

<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:** [June 8, 2017, 2:06pm UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/7 "2017-06-08T14:06:03Z")

</div>

Looks better…now in your config.xml find the line where you’ve got

```
 drawable-hdpi-icon.png

```

and remove the line (or create the icon, but for test at least will be faster to remove it)

Then rm/add the platform again

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 9, 2017, 6:47am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/8 "2017-06-09T06:47:33Z")

</div>

Its not working , Package and name are showing the old app

---

<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:** [June 9, 2017, 6:59am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/9 "2017-06-09T06:59:45Z")

</div>

what do you mean? did you remove the drawable-hdpi-icon.png in your config.xml? did you remove and add the platform again?

could you plz paste the ALL log of the cmd you are running?

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 9, 2017, 7:03am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/10 "2017-06-09T07:03:58Z")

</div>

yes i removed the drawable-hdpi-icon.png from config.xml then ran the below command

parthas-MacBook-Pro:App parthpratim$ ionic cordova platform rm android

> cordova platform remove android --save  
> ✔ Running command - done!  
> Removing platform android from config.xml file…  
> parthas-MacBook-Pro:App parthpratim$ ionic cordova platform add android@latest  
> cordova platform add android@latest --save  
> ✖ Running command - failed!

[ERROR] Cordova encountered an error.  
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova platform add android@latest --save (exit code 1):

```
    Using cordova-fetch for cordova-android@latest
    Adding android project...
    Creating Cordova project for the Android platform:
    	Path: platforms/android
    	Package: com.ionicframework.trapapp152823
    	Name: TrapApp
    	Activity: MainActivity
    	Android target: android-25
    Subproject Path: CordovaLib
    Android project created with cordova-android@6.2.3
    Error: Source path does not exist: resources/android/icon/drawable-hdpi-icon.png

```

**Can you see the name : TrapApp? why it is showing here any idea ? its my old project**

---

<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:** [June 9, 2017, 7:20am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/11 "2017-06-09T07:20:00Z")

</div>

Do you use windows?

Found that post [https://stackoverflow.com/a/40458796/5404186](https://stackoverflow.com/a/40458796/5404186) maybe this solution works for you?

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 9, 2017, 7:23am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/12 "2017-06-09T07:23:49Z")

</div>

i am using mac, i have seen the post earlier dint work for me either

---

<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:** [June 9, 2017, 7:25am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/13 "2017-06-09T07:25:51Z")

</div>

well I’m out of ideas. If you removed the line

```
<icon density="hdpi" src="resources\android\icon\drawable-hdpi-icon.png" />

```

from your config.xml, I don’t understand why you still got the error.

---

<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:** [June 9, 2017, 7:58am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/14 "2017-06-09T07:58:52Z")

</div>

I’d make sure that the file exists by running `ionic cordova resources` again (or just create one manually). Seems like an easy fix.

@partha_pratim: Please edit your post and use the `</>` button above the post input field to format your code or error message or wrap it in ````` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.[quote=“partha\_pratim, post:10, topic:93486”]  
Can you see the name : TrapApp? why it is showing here any idea ? its my old project  
[/quote]

Are you sure you are in the right directory and everything?

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 9, 2017, 8:08am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/15 "2017-06-09T08:08:18Z")

</div>

```auto
parthas-MacBook-Pro:App parthpratim$ clear

parthas-MacBook-Pro:App parthpratim$ ionic cordova resources
✔ Collecting resource configuration and source images - done!
[ERROR] No platforms have been added. Please run: ionic cordova platform add

```

yes i am on the right directory.

But when i run ionic cordova platform add android

```auto
parthas-MacBook-Pro:App parthpratim$ ionic cordova platform add android
> cordova platform add android --save
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.
        
[ERROR] An error occurred while running cordova platform add android --save (exit code 1):
        
        Using cordova-fetch for cordova-android@^6.2.3
        Error: Platform android already added.

```

---

<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:** [June 9, 2017, 8:24am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/16 "2017-06-09T08:24:04Z")

</div>

> [@partha\_pratim](#):
>
> Error: Platform android already added.

That is pretty clear.  
If you want to add it again (for whatever reason), you have to remove it first: `ionic cordova platform remove android`

And again:  
Please edit your post and use the `</>` button above the post input field to format your code or error message or wrap it in ````` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 9, 2017, 8:37am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/17 "2017-06-09T08:37:17Z")

</div>

I already added `</>` button

if it is already added then why i am getting below error.  
`ionic cordova resources ✔ Collecting resource configuration and source images - done! [ERROR] No platforms have been added. Please run: ionic cordova platform add`

---

<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:** [June 9, 2017, 9:28am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/18 "2017-06-09T09:28:11Z")

</div>

Seems something is wrong.

Post your current `ionic info` output again please.

---

<div class="post-metadata">

**Author:** ![partha\_pratim](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@partha\_pratim](https://forum.ionicframework.com/u/partha_pratim)\
**Post date:** [June 9, 2017, 9:34am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/19 "2017-06-09T09:34:40Z")

</div>

```auto
parthas-MacBook-Pro:App parthpratim$ ionic info

global packages:

    @ionic/cli-utils : 1.3.0
    Cordova CLI : 7.0.1 
    Ionic CLI : 3.3.0

local packages:

    @ionic/app-scripts : 1.3.7
    @ionic/cli-plugin-cordova : 1.3.0
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Cordova Platforms : android 6.2.3 ios 4.4.0
    Ionic Framework : ionic-angular 3.3.0

System:

    Node : v6.10.3
    OS : macOS Sierra
    Xcode : Xcode 8.3.1 Build version 8E1000a 
    ios-deploy : not installed
    ios-sim : 5.0.13 

```

---

<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:** [June 9, 2017, 9:38am UTC](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486/20 "2017-06-09T09:38:52Z")

</div>

Ok, so `ionic info` recognizes the platforms which means that `cordova platform list` does, too.

Now run `ionic cordova resources --verbose`.

[Next page](https://forum.ionicframework.com/t/not-able-to-add-platform-after-upgrading-to-ionic-3/93486.md?page=2)
