cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <>
Subject [jira] [Updated] (CB-12594) Local development of plugins with variables need variables in fetch.json
Date Fri, 08 Sep 2017 16:28:00 GMT


Joe Bowser updated CB-12594:
    Component/s:     (was: cordova-plugins)
                     (was: cordova-android)
                     (was: cordova-ios)

This is definitely a cordova-lib problem

> Local development of plugins with variables need variables in fetch.json
> ------------------------------------------------------------------------
>                 Key: CB-12594
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-cli, cordova-lib
>            Reporter: Philipp Kursawe
>              Labels: cordova-8.0.0
> Consider a plugin that defined a preference in its plugin.xml
> When you use the CLI feature to save plugins into config.xml and also add the variables
for this plugin, the CLI complains when adding the plugin during platform restore (missing
> {code:title=plugin.xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <plugin
>     xmlns=""
>     xmlns:android=""
>     id="cordova-plugin" version="1.0">
>     <preference name="COMPANY_NAME" />
> {code}
> {code:title=config.xml}
> <plugin name="cordova-plugin" spec="cordova-plugin-insert-io">
>         <variable name="COMPANY_NAME" value="acme" />
> {code}
> When removing a platform and re-adding it this is the result:
> {code}
> Installing "cordova-plugin" for android
> Failed to install 'cordova-plugin':Error: Variable(s) missing: COMPANY_NAME
>     at /Users/xxx/.nvm/versions/node/v6.2.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:362:23
>     at _fulfilled (/Users/xxx/.nvm/versions/node/v6.2.0/lib/node_modules/cordova/node_modules/q/q.js:787:54)
>     at self.promiseDispatch.done (/Users/xxx/.nvm/versions/node/v6.2.0/lib/node_modules/cordova/node_modules/q/q.js:816:30)
>     at Promise.promise.promiseDispatch (/Users/xxx/.nvm/versions/node/v6.2.0/lib/node_modules/cordova/node_modules/q/q.js:749:13)
>     at /Users/xxx/.nvm/versions/node/v6.2.0/lib/node_modules/cordova/node_modules/q/q.js:557:44
>     at flush (/Users/xxx/.nvm/versions/node/v6.2.0/lib/node_modules/cordova/node_modules/q/q.js:108:17)
>     at _combinedTickCallback (internal/process/next_tick.js:67:7)
>     at process._tickCallback (internal/process/next_tick.js:98:9)
> Error: Variable(s) missing: INSERT_COMPANY_NAME
> {code}
> It seems, the CLI checks the fetch.json file, and if that does not contain the variables,
it fails with this error. Manually adding the variables to the fetch.json file, or re-installing
the plugin helps (reinstalling rewrites the fetch.json file).
> That means, if we add a variable to our plugin during plugin development, we would have
to remove the plugin (unlink) it first, and then re-add it, specifying all the variables at
the CLI.
> How it should actually work is that config.xml has precedence over whatever it says in
fetch.json. Or get rid of fetch.json alltogether. I think its only there for historical reasons?

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message