0

I'm setting up a first cordova projecct.

After installing globally Cordova and creting a first app repository am trying to set up the android platform within this command:

cordova platform add android --save

But this action ends up by generation this error message:

BUILD FAILED

Total time: 0.989 secs Failed to install 'cordova-plugin-whitelist':Error: /home/firas/Bureau/Cordova/HelloWorld/HelloWorld/platforms/android/gradlew: Command failed with exit code 1 at ChildProcess.whenDone (/home/firas/Bureau/Cordova/HelloWorld/HelloWorld/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:821:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) Error: /home/firas/Bureau/Cordova/HelloWorld/HelloWorld/platforms/android/gradlew: Command failed with exit code 1

I have tried to remove and re-add the adroid platform , but the problem persists , also I have tried to install the whitelist plugin (cordova plugin add cordova-plugin-whitelist@1.0.0 )

but also I faced the same problem , and finish by not being able to build or run my first HelloWord app

Cœur
  • 37,241
  • 25
  • 195
  • 267
firasKoubaa
  • 6,439
  • 25
  • 79
  • 148

2 Answers2

0
Destroyer.0211
  • 113
  • 1
  • 3
  • 13
0

This issue appears especially with Cordova 6.4.0 (latest until 31 December 2016) .

To solve this problem, simply uninstall Cordova and re-install it for the version 6.0.0 which affords more stability with the whitelist component.

Steps:

  1. npm uninstall -g cordova
  2. npm install -g cordova@6.0.0
Phonolog
  • 6,321
  • 3
  • 36
  • 64
firasKoubaa
  • 6,439
  • 25
  • 79
  • 148
  • Before that version the version was `6.2.0` is still working fine with all the command and plugins, so you can install this version too. We have found many issues with using the latest 6.4.0 version for old + new project of cordova. – Kirankumar Dafda Jan 02 '17 at 11:12
  • @firasKoubaa I have the latest cordova 6.4.0 and i m able to add android platform with no issues. Guess u may have to dig deep to conclude – Gandhi Jan 02 '17 at 15:12
  • it may depends with which version of sdk u use , the conclusion comes from the non stability of this version relatively to the 6.0.0 or the 6.2.0 – firasKoubaa Jan 02 '17 at 15:44