# Ionic state restore alternative

**URL:** <https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615>\
**Category:** Ionic Framework\
**Created:** [February 18, 2019, 12:55am UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615 "2019-02-18T00:55:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jampanha](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jampanha](https://forum.ionicframework.com/u/jampanha)\
**Post date:** [February 18, 2019, 12:55am UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/1 "2019-02-18T00:55:23Z")

</div>

I am using ionic 4.

After I clone an ionic 4 project, I want to add all of the cordova plugins from package.json.  
\*\*Note “npm install” does not add the plugins automatically.

At the moment I have to manually run these commands:

ionic cordova plugin add cordova-plugin-inappbrowser@latest  
…

---

<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:** [February 18, 2019, 5:21am UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/2 "2019-02-18T05:21:15Z")

</div>

If you rm/add the platform, iOS or Android, it will fetch the plugins

---

<div class="post-metadata">

**Author:** ![jampanha](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jampanha](https://forum.ionicframework.com/u/jampanha)\
**Post date:** [February 19, 2019, 9:58am UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/3 "2019-02-19T09:58:28Z")

</div>

```
$ ionic capacitor <command>

add ............................. (beta) Add a native platform to your Ionic project
copy ............................ (beta) Copy web assets to native platforms
open ............................ (beta) Open the IDE for a given native platform project
run ............................. (beta) Run an Ionic project on a connected device
sync ............................ (beta) Sync (copy + update) an Ionic project
update .......................... (beta) Update Capacitor native platforms, install Capacitor/Cordova plugins
```

---

<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:** [February 19, 2019, 10:05am UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/4 "2019-02-19T10:05:08Z")

</div>

So you are using Capacitor and not Cordova?

---

<div class="post-metadata">

**Author:** ![jampanha](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jampanha](https://forum.ionicframework.com/u/jampanha)\
**Post date:** [February 19, 2019, 10:25pm UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/5 "2019-02-19T22:25:59Z")

</div>

Yeah,  
I’m using Capacitor.

There is no way to remove platform, then add it again.

---

<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:** [February 20, 2019, 11:40am UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/6 "2019-02-20T11:40:27Z")

</div>

Yeah, @reedrichards 's advice was based on the assumption that you are using Cordova.

My Capacitor knowledge is wonky as well, but shouldn’t your native project be part of your version control / git and thus already include the plugins?

---

<div class="post-metadata">

**Author:** ![jampanha](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jampanha](https://forum.ionicframework.com/u/jampanha)\
**Post date:** [February 20, 2019, 10:29pm UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/7 "2019-02-20T22:29:31Z")

</div>

that’s what I thought too… but when I clone the project to another machine. The error said plugins not found!

---

<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:** [February 21, 2019, 12:21pm UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/8 "2019-02-21T12:21:40Z")

</div>

What error when running which command? You haven’t mentioned those yet.

---

<div class="post-metadata">

**Author:** ![jampanha](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jampanha](https://forum.ionicframework.com/u/jampanha)\
**Post date:** [February 21, 2019, 11:01pm UTC](https://forum.ionicframework.com/t/ionic-state-restore-alternative/156615/9 "2019-02-21T23:01:37Z")

</div>

when use this command

ionic capacitor run android

In the android-studio project when compiling this error occurs:

C:\Users\Wallst\Documents\ionic4\_starter\android\capacitor-cordova-android-plugins\cordova.variables.gradle (The system cannot find the path specified)

unless I remove and reinstall all of the plugins.
