Using command (example plugins):
ionic plugin add org.apache.cordova.contacts
will add an entry to package.json => cordovaPlugins array:
"cordovaPlugins": [
"org.apache.cordova.contacts"
]
But using such command (adding plugin from url, not package name):
ionic plugin add https://github.com/cordova-sms/cordova-sms-plugin.git
Wont add any entries to cordovaPlugins.
However, after use:
ionic state save
we got in package.json:
"cordovaPlugins": [
"org.apache.cordova.contacts",
{
"locator": "https://github.com/cordova-sms/cordova-sms-plugin.git",
"id": "com.cordova.plugins.sms"
}
],
This happens for me too.
+1
also happens to me:
running:
ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git
doesn't add nothing to package.json. Although:
$ cordova plugin list
...
cordova-plugin-crosswalk-webview 1.0.1-dev "Crosswalk WebView Engine"
cordova-plugin-whitelist 1.0.1-dev "Whitelist"
...
Also nothing on package.json after this:
$ ionic state save
Saving your Ionic app state of platforms and plugins
Saved platform
There was no fetch.json file available to restore plugin information from.
Restoring plugins from scanning the plugins folder is still being worked on.
Saved plugins
Saved package.json
This should be working in the latest beta - npm install -g ionic@beta.
I have the same issue even using ionic@beta
ionic plugin add https://github.com/wymsee/cordova-imagePicker.git
Updated the hooks directory to have execute permissions
Fetching plugin "https://github.com/wymsee/cordova-imagePicker.git" via git clone
Repository "https://github.com/wymsee/cordova-imagePicker.git" checked out to git ref "master".
But nothing is updated, the command ionic plugin listis not showing the plugin I try to install :(
In my opinion this is a problem linked with cordova since I can't install the plugin using the vanilla cordova command. Trying to solve this issue I did a npm install -g [email protected] and it fixes the problem (cf http://stackoverflow.com/questions/30801307/upgrade-cordova-cannot-install-plugins-from-git-urls-anymore). Maybe ionic should catch the error to give a more easy to understand view of the problem.
I'm still seeing this with ionic 1.6.5
also still seeing this issue. I have to manually keep my package.json up to date
They don't save for me either. On top of that, ionic state save fails with the following:
There was an error saving your current Ionic setup
ReferenceError: self is not defined
at /Users/me/.nvm/versions/node/v5.4.1/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/state.js:292:14
My info if you need it:
Cordova CLI: 5.4.1
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.13
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.4
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.4.1
Xcode version: Xcode 7.2 Build version 7C68
also seeing this issue...
Issue still persists !
Ionic version 2.0.0-beta.17, the issue still persists. I am trying to run: ionic plugin add ../cordova-plugin-ble-central (which is a cloned repository with my own change). Plugin is installed but nothing is added to package.json file.
ionic-cli version 1.7.12
cordova plugin add phonegap-plugin-barcodescanner doesn't update package.json too.
Is this issue fixed in newer version?
Still a problem here (1.7.14)
Works for me on 1.7.14
This is how it is shown if you wanna add manually:
{
"locator": "https://github.com/phonegap/phonegap-plugin-barcodescanner.git",
"id": "phonegap-plugin-barcodescanner"
},
It works on ionic 1.7.14
Make sure you run ionic plugin add not cordova plugin add command.
Yes I confirm It works on ionic 1.7.14
Make sure you run ionic plugin add not cordova plugin add command.
The problem is still reproducible in ionic 1.7.15 but it depends on the other plugins that are already installed (note: it does not seem to depend on entries _available in package.json_ but plugins _installed!_)
When I do ionic plugin add https://github.com/VersoSolutions/CordovaClipboard.git it does not add anything to package.json. So I removed all entries in package.json cordovaPlugins fields, uninstall the plugin via cordova plugin rm com.verso.cordova.clipboard, and try to install again, and it populates package.json with
{
"locator": "https://github.com/VersoSolutions/CordovaClipboard.git",
"id": "phonegap-plugin-push"
}
so it takes the locator of the proper plugin just installed, but id of entirely different plugin :O
when do ionic state save OTOH, it creates good entry
{
"locator": "https://github.com/VersoSolutions/CordovaClipboard.git",
"id": "com.verso.cordova.clipboard"
}
So there's some weird code bug behind it.
seeing this too with
ionic plugin add https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking.git --save --variable BRANCH_KEY=mykey --variable URI_SCHEME=test
package.json not updated
This problem appears to either have been reintroduced, or never fully resolved. I'm seeing this with the following ionic versions on brand new project created from ionic start spatialite-test --v2:
ionic info
Your system information:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v5.1.0
Xcode version: Xcode 7.3 Build version 7D175
Trying to install:
ionic plugin add https://github.com/DisyInformationssysteme/Cordova-spatialite-storage
Same here, this morning, in a ionic 1 project, doing ionic plugin add cordova-plugin-google-analytics
$ ionic -v
2.1.1
Yep, I experienced this a few days ago as well, when installing cordova-plugin-ms-adal.
Same issue for the barcode scanner on ionic 2. ionic plugin add phonegap-plugin-barcodescanner does not update package.json.
ionic info
Cordova CLI: 6.3.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.9
OS: Mac OS X El Capitan
Node Version: v6.2.1
Xcode version: Xcode 8.1 Build version 8B62
Same here.
ionic info
--------------------------------
--------------------------------
Your system information:
Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
ios-deploy version: 1.8.4
ios-sim version: 5.0.8
OS: Mac OS X Sierra
Node Version: v4.6.1
Xcode version: Xcode 8.0 Build version 8A218a
--------------------------------
Yes I am experiencing the same problem. I noticed in the plugins folder, there is a fetch.json file. Is it ok to put it under version control?
@tobiasfiechter I don't know but I did it since there is no other way to tack installed plugin at the moment
@all I don't think this is ever going to get fixed as ionic guys wrote in some other US they are going to deprecate state commands, and I think package.json saves too, since it's related, as newer cordova versions are doing this stuff already (though through config.xml)
https://github.com/driftyco/ionic-cli/issues/904
https://github.com/driftyco/ionic-cli/issues/1324
while it still works, if you want to keep using package.json, you may prefer to put stuff direclty in package.json first, and then do ionic state restore --plugins (it will iterate over all plugins though, which might take a while...)
2017 and still happening! Getting furious over here, since this is not the only bug in ionic cli that still exists!!!
ionic info output:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v7.5.0
Xcode version: Xcode 8.1 Build version 8B62
+1
this won't add pluginName into package.json:
ionic start --v2 myApp
ionic plugin add pluginName
but I've managed to save it by running (not sure why, ref article):
ionic state save
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.9.3
Xcode version: Xcode 8.2.1 Build version 8C1002
@mhhansen @mehrad-rafigh Have a look to the previous @jakub-g comment. I think you should use the --save option. It's the same effect but in the config.xml file.
After all, this isn't that bad. That don't really make sens to store Cordova plugins informations (who's managed by Cordova) in the NPM file. It seems more clear to store Cordova's stuff in Cordova's config file.
ionic state save worked for me
The custom plug-in installation times wrong, how should solve
Error: Invalid Plugin! E:\Often\CordovaPlugin\cordova-plugin-tree needs a valid package.json
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.0
@ionic/cli-plugin-cordova : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms : none
Ionic Framework : ionic-angular 3.0.0
System:
Node : v7.9.0
OS : Windows 7
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
@wardenlzr If you ever see that error, it means the plugin you're trying to add doesn't yet support Cordova 7. You can either downgrade to Cordova 6 or open an issue in the repo for that Cordova plugin.
@dwieeb Thank you very much, indeed.Use your method to solve
In a custom plug-in callback, open a new page, the page to refresh the data
Like this,
TreePlugin.template([T.R_MobileLaw.Api.MobileLawService.host], result => {
let data = result.split("#");
T.TemplateId = data[1];//模板Id
T.nav.push(Page_MobileLaw_Task_Investigate_Issue, { TemplateId: T.TemplateId});
}, error => {
// alert(error); //(失败的回调)
});
Page_MobileLaw_Task_Investigate_Issue
In this interface, data cannot real-time refresh
Who can help me?Thank you very much
Latest way to save your state:
ionic cordova plugin save
Also good to know: ionic has a 'doctor' command that will check your project and fix things automatically. Just run the following:
ionic doctor check
then follow the instructions.
I hope this helps someone.
Most helpful comment
@mhhansen @mehrad-rafigh Have a look to the previous @jakub-g comment. I think you should use the --save option. It's the same effect but in the
config.xmlfile.After all, this isn't that bad. That don't really make sens to store Cordova plugins informations (who's managed by Cordova) in the NPM file. It seems more clear to store Cordova's stuff in Cordova's config file.