cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Valentin Haloiu (JIRA)" <>
Subject [jira] [Created] (CB-13853) Plugin installation is not deterministic
Date Tue, 06 Feb 2018 12:55:00 GMT
Valentin Haloiu created CB-13853:

             Summary: Plugin installation is not deterministic
                 Key: CB-13853
             Project: Apache Cordova
          Issue Type: Bug
          Components: cordova-lib
    Affects Versions: cordova@8.0.0
         Environment: * Node {{9.5.0}}
 * NPM {{5.6.0}}
 * Cordova {{8.0.0}}
            Reporter: Valentin Haloiu

h2. Demo cordova project

h2. Steps to reproduce

After cloning the repo {{cd}} into the root directory of the project and run:
 * {{npm install}}
 * {{cordova prepare ios --verbose}}

The plugins will fail to install correctly and the contents of the generated {{plugins/fetch.json}}
file is messed up:
  "cordova-plugin-whitelist": {
    "source": {
      "type": "registry",
      "id": "cordova-plugin-whitelist@1.3.1"
    "is_top_level": true,
    "variables": {}
  "cordova-plugin-splashscreen": {
    "source": {
      "type": "registry",
      "id": "cordova-plugin-customurlscheme@^4.3.0"
    "is_top_level": true,
    "variables": {
      "URL_SCHEME": "io.cordova.hellocordova"
 Also, the output of the {{cordova prepare ios --verbose}} makes it quite clear that something
went wrong during the installation:
Discovered plugin "cordova-plugin-customurlscheme" in config.xml. Adding it to the project
No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "cordova-plugin-customurlscheme@^4.3.0"
Running command: npm install cordova-plugin-customurlscheme@^4.3.0 --production --no-save
Command finished with error code 0: npm install,cordova-plugin-customurlscheme@^4.3.0,-production,-no-save
Copying plugin "/path-to-project/cordova-install-plugin-bug/node_modules/cordova-plugin-splashscreen"
=> "/path-to-project/cordova-install-plugin-bug/plugins/cordova-plugin-splashscreen"
Calling plugman.install on plugin "/path-to-project/cordova-install-plugin-bug/plugins/cordova-plugin-splashscreen"
for platform "ios
Plugin "cordova-plugin-splashscreen" already installed on ios.
The installation process seems to mess up the installation of the {{customurlscheme}} plugin
with that of the {{splashscreen}} plugin.
h2. Underlying code issue

The root of the problem seems to be in the [add.js|]
{{cordova-lib}} file.

[Line 97|]
prints the {{Calling plugman.fetch on plugin "customurlscheme"}} line, while [line 131|]
prints {{Calling plugman.install on plugin "splashscreen"}}.

This seems to suggest that somewhere between these two lines cordova messes up the plugins

The code is somewhat difficult to understand but the root cause seems to be this [pluginInfo|]
global variable. Its value is [assigned in the callback of a promise|],
read from [another callback of a promise|],
while [a whole chain of promises|]
is set using a {{reduce}} function.
h2. Further information

Replacing {{"cordova-plugin-splashscreen": "^5.0.1"}} with {{"cordova-plugin-splashscreen":
"5.0.1"}} in {{package.json}} makes the {{prepare}} command complete succesfully ([demo branch|]).
This is a small example of the volatility of the bug.

This message was sent by Atlassian JIRA

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

View raw message