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

'cordova plugin add <plugin> --save' should save variables into config.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • cordova-lib
    • None

    Description

      When adding a plugin with the --save/autosave option on, the variables (if any is passed) should be saved into config.xml so that the plugin can be auto-restored successfully later during 'prepare' or 'build' operation.

      For example:

      • cordova create hello com.omefire.hello Hello
      • cd hello
      • cordova plugin add com.phonegap.plugins.facebookconnect --variable APP_ID="my-app-id" --variable APP_NAME="my-app-name" --save => results in facebook plugin added to config.xml
      • cordova prepare android => results in an error message :

      " Installing "com.phonegap.plugins.facebookconnect" for android
      Failed to install 'com.phonegap.plugins.facebookconnect':Error: Variable(s) missing: APP_ID, APP_NAME "

      This issue is due to the fact that 'cordova plugin add <plugin> --save' save variables in config.xml using the <param> tag instead of the <variable> tag.

      N.B: on 'cordova prepare <platform>', the plugins are restored from config.xml if they are not yet installed.

      Attachments

        Activity

          People

            gercan Gorkem Ercan
            omefire Omar Mefire
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: