ionic-team / ionic-plugin-deeplinks

Handle deeplinks into your Ionic/Cordova apps from Universal Links, App Links, and Custom URL schemes. For those using Ionic 2, there are some nice goodies that make life easier.
Other
332 stars 220 forks source link

Cannot restore plugin on platform add #138

Open horodnicdragos opened 6 years ago

horodnicdragos commented 6 years ago

Greetings!

I am using ionic-cli 3.19.0 and I want to add ios platform like this:

ionic cordova platform add ios I have all my plugins saved in config.xml, here is how this one is stored:

`

    <variable name="DEEPLINK_SCHEME" value="https" />
    <variable name="DEEPLINK_HOST" value="something.com" />
    <variable name="ANDROID_PATH_PREFIX" value="/" />
</plugin>`

The error I get is the following:

`Failed to install 'ionic-plugin-deeplinks':Error: Variable(s) missing: URL_SCHEME, DEEPLINK_HOST at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:362:23 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9)

Error: Variable(s) missing: URL_SCHEME, DEEPLINK_HOST`

Is there any workaround to avoid adding the plugin from CLI and then restoring my config.xml as it was before? It is quite cumbersome doing this over and over again.

Thank you!

GreenRover commented 6 years ago

The problem also exist when addint it via package.json "plugins" section

chrisweight commented 6 years ago

@horodnicdragos - have you checked your 'plugins/fetch.json` to see if the variables are present in the plugin node there too?

royalrex commented 5 years ago

I have the same problem when I run ionic cordova platform add ios. It used to be okay, but for some reason, now I get this issue too.

Trying to install version 1.0.17 (latest).

@chrisweight I checked the plugins/fetch.json file and the correct variables are there, as well as in package.json and config.xml.

Any suggestions?

Ionic info gives:

Ionic:

   ionic (Ionic CLI)  : 4.7.1
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 9 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/sebbe/Library/Android/sdk/)
   ios-deploy        : 1.9.4
   NodeJS            : v10.14.1 (/Users/sebbe/.nvm/versions/node/v10.14.1/bin/node)
   npm               : 6.4.1
   OS                : macOS High Sierra
   Xcode             : Xcode 10.1 Build version 10B61
royalrex commented 5 years ago

Did some further fooling around and found the problem.

I have added my plugins dir to git to speed up build times in my CD system, as it would no longer need to pull all the plugins (takes forever). However, removing plugins dir or ionic-plugin-deeplinks dir, fixes this issue.

Don't know if there is anyway the plugin can be "reinstalled" somehow if it already exists.

dhayaljaswantgit commented 5 years ago

You can just use : cordova plugin add ionic-plugin-deeplinks@latest

this will install latest version of plugin and issue will resolved

jpike88 commented 3 years ago

Took me 5 hours to realise this is so broken fundamentally.

@elylucas can you give some insight?