Install plugin from local directory


I’m trying to package an app with a plugin installed from GITHUB or from a Local path.
But when everytime I package my app I have this message :

Discovered plugin “urbanairship-cordova” in config.xml. Adding it to the project
Failed to restore plugin “urbanairship-cordova” from config.xml. You might need to try adding it again. Error: Failed to fetch plugin 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

Does anyone have an idea?


1 Like

Same, cannot install from Github, it always says via registry, is that right?

I was able to install using cordova plugin add git://link.git --nofetch, but that’s bad because ionic cordova build browser doesn’t restore with this parameter, so it breaks.

cli packages:

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0

That’s right ! I think there is a way, but I didn’t find it !
The build is alright, but the package failed on ionic backend, so it’s the reason why I asked on a previous post if I can package my app locally. The answer is yes, so for now, I think the best way is to package app locally unfortunately.

As you already said; you can just package locally.
When building an platform Ionic actually just creates an “empty” wrapper project for that platform. Then the cli executes the default ‘package-this-project-to-an-apk/ipa’ command. Basically this means Ionic isn’t actually creating an APK or IPA. It just executes the commands which let’s your platform tools to build/export/package your project.

So what you can do is run ionic cordova build anroid / ios --prod --release. Wait for it to finish. Then in the ‘platforms’ folder you’ll see the builded project. Just open that folder/project with your platform IDE. Use your IDE to adjust/edit/build/export/package your ‘project’ and you’re good to go.

Working with your local platform tools will give you more options of adjusting/handling and debugging down to “real-app” and/or system OS level. Therefore I don’t see the benefits of using the Ionic ‘Pro’ backend, while you can do this all by your self! Buttt, for the average Ionic user I do think the usage of Ionic Pro would be easier and better.

P.s. This is what I’ve understood of the Ionic method. Please correct me if I’m wrong!

Download the plugin from Git to a local drive.

  • Extract the zip folder
  • try to install using command cordova plugin add “path you have extracted the folder”*(eg:cordova plugin add C:\Users\username\Downloads\urbanairship-cordova-master)
  • make sure you have served all the requirements for urbanairship(Android GCm/FCM etc.,.)