Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10921

Plugin not installed when variable not supplied, no error message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 6.0.0
    • None
    • cordova-cli
    • Mac OS 10.11.3.

    Description

      When I include a plugin in config.xml, and the plugin declares a <preference>, but the config.xml doesn't supply a corresponding <variable>, cordova prepare doesn't show an error message.

      I started with a new project, with no plugins or platforms. Then I added specific <engine> versions to config.xml. Finally I added a <plugin> whose plugin.xml file declares a variable <preference name="URL_SCHEME" />. But I don't supply the required <variable>:

          <engine name="ios" spec="~4.1.0" />
          <engine name="android" spec="~5.1.1" />
          <plugin name="cordova-plugin-whitelist" spec="1" />
          <plugin name="cordova-plugin-customurlscheme" spec="~4.1.5" />
      

      When I run cordova prepare, it says:

      Copying plugin "/Users/someone/.npm/cordova-plugin-customurlscheme/4.1.5/package" => "/Users/someone/CordovaTest/plugins/cordova-plugin-customurlscheme"
      

      but it doesn't actually copy the plugin there. Nor does it make any changes to either platform's config.xml file, or to any other config files.

      On the other hand, if I try to manually install the plugin using cordova plugin add cordova-plugin-customurlscheme, it shows me the appropriate error message:

      Error: Variable(s) missing (use: --variable URL_SCHEME=value).
      

      Side note: it seems to be repeating certain steps for every plugin installed. For example, it repeats:

      Wrote out Android application name to "CordovaTest"
      Wrote out Android package name to "com.test.cordovatest"
      

      Attachments

        Issue Links

          Activity

            People

              vladimir.kotikov Vladimir Kotikov
              jweber Jacob Weber
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: