Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ionic state reset --plugins resets platforms #399

Closed
perrygovier opened this issue Apr 27, 2015 · 10 comments · May be fixed by ionic-team/ionic-app-lib#70
Closed

bug: ionic state reset --plugins resets platforms #399

perrygovier opened this issue Apr 27, 2015 · 10 comments · May be fixed by ionic-team/ionic-app-lib#70

Comments

@perrygovier
Copy link
Contributor

From @RangerRick on April 25, 2015 16:10

Type: bug

Platform: all

When I run ionic state reset --plugins it also resets platforms:

Sin:~/git/opennms-compass ranger$ ionic state reset --plugins
Removed platforms and plugins
Attempting to restore your Ionic application from package.json

Restoring Platforms

cordova platform add android
cordova platform add browser
cordova platform add ios

Restore platforms is complete

Restoring Plugins

cordova plugin add org.apache.cordova.console
cordova plugin add org.apache.cordova.geolocation
cordova plugin add org.apache.cordova.inappbrowser
cordova plugin add org.apache.cordova.network-information
cordova plugin add org.apache.cordova.splashscreen
cordova plugin add org.apache.cordova.statusbar
cordova plugin add com.google.cordova.admob
cordova plugin add cc.fovea.cordova.purchase
cordova plugin add com.ionic.keyboard
cordova plugin add https://github.com/RangerRick/cordova-certificate-plugin.git 
cordova plugin add com.ohh2ahh.plugins.appavailability
cordova plugin add com.google.playservices
Restore plugins is complete

Ionic state restore completed

Ionic reset state complete
```</span>

<span is-issue-template></span>


_Copied from original issue: driftyco/ionic#3617_
@jbavari
Copy link

jbavari commented Apr 28, 2015

This has been fixed in the latest branch. It'll be available in the next release.

Feel free to test the beta - npm install -g ionic@extlib

@jbavari jbavari closed this as completed May 8, 2015
@surfjedi
Copy link

surfjedi commented Nov 3, 2015

This seems to still happen..

@codeincontext
Copy link

+1 I'm getting this

@jakub-g
Copy link

jakub-g commented Feb 17, 2016

using [email protected] I can reproduce the opposite scenario, i.e. I run ionic state reset --platforms but it also resets plugin.

Note the first line of the output which says Removed platforms and plugins

So, while only the one passed via command line (--platforms or --plugins) is restored, both are removed

The bug is here, the removal of platforms and plugins should be separated

@jakub-g
Copy link

jakub-g commented Feb 17, 2016

I sent a PR for this, it would be pretty useful to have this working.

In my use case I want to do ionic state reset --platforms as a part of a script instead of cordova platform rm android && cordova platform add android, so that the proper platform version is taken from package.json. I don't need to reset plugins, and plugin is much more costly

@jakub-g
Copy link

jakub-g commented Feb 17, 2016

As a temporary fix I'm using restore instead of reset and remove things myself:

    cordova platform rm android && ionic state restore --platforms

instead of

    ionic state reset --platforms

jakub-g added a commit to jakub-g/ionic-app-lib that referenced this issue Feb 19, 2016
@rob3c
Copy link

rob3c commented Sep 12, 2016

The same problem happens with the clear command:
ionic state clear --platforms
also clears plugins, and vice versa.

@salazarr-js
Copy link

this still happening... 😞

Cordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.4.0
Xcode version: Not installed

@helixhuang
Copy link

@imhoffd
Copy link
Contributor

imhoffd commented May 4, 2018

The best thing to do to reset Cordova platforms & plugins is to clean out Cordova build directories and reinstall/recompile everything:

rm -rf platforms/ plugins/
ionic cordova prepare

@ionic-team ionic-team locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants