Can't restore plugins after cloning project from repo
See original GitHub issueHi, I’m having problems to restore my plugins from a private project in github after updating from cordova 6.5 to 8.1.2. Basically I have a .gitignore
for the folders plugins/
and platforms/
as they are generated and contain duplicated data. I’ve used in that way till now without issues. I had to upgrade my project, now I can’t use this approach anymore. When I try to restore the project I get errors like the one below.
I tried to downgrade and use a previous version of cordova, like 7, but still not working.
I’m using ionic here, but I can get same error when I try directly with cordova commands.
Another note is that this is not happening with plugins in npm public repo, the ones I add with a name, just with the ones I have to add with a git url.
Thanks
Error: Discovered plugin “cordova-plugin-telerik-imagepicker” in config.xml. Adding it to the project Failed to restore plugin “cordova-plugin-telerik-imagepicker” from config.xml. You might need to try adding it again. Error: Failed to fetch plugin git+https://github.com/Telerik-Verified-Plugins/ImagePicker.git via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Failed to get absolute path to installed module
How to reproduce:
ionic version: 4.10.2
cordova version: 8.1.2
These steps are used to create a project from the scratch
ionic start ionic-issue-dependencies blank --type=ionic-angular
cd ionic-issue-dependencies
ionic cordova platform add android
ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git
This would be done before saving to github (actually done via .gitignore)
rm -rf plugins
rm -rf platforms
rm -rf node_modules
This is normally done after a fresh clone of the repo
npm install
ionic cordova platform add android
Logs:
$ ionic cordova platform add android
> cordova platform add android --save
Using cordova-fetch for cordova-android@7.1.4
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.ionic.starter
Name: MyApp
Activity: MainActivity
Android target: android-27
Android project created with cordova-android@7.1.4
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for android
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for android
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-webview" for android
Subproject Path: CordovaLib
Subproject Path: app
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
Discovered plugin "cordova-plugin-ionic-keyboard" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-keyboard" for android
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for "cordova-plugin-ionic-keyboard" to config.xml
Discovered plugin "cordova-plugin-telerik-imagepicker" in config.xml. Adding it to the project
Failed to restore plugin "cordova-plugin-telerik-imagepicker" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin git+https://github.com/Telerik-Verified-Plugins/ImagePicker.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module
--save flag or autosave detected
Saving android@~7.1.4 into config.xml file ...
[ERROR] An error occurred while running subprocess cordova.
cordova platform add android --save exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
Discussion on this same problem
https://stackoverflow.com/questions/50749953/cordova-8-how-do-you-add-plugins-that-are-not-in-npm-registry
I saw this issue, but it started working for me after I downgraded to node 14.18.2?