[英]Cordova 6.4.0: android platform install Whitelist error
I'm setting up a first cordova projecct. 我正在设置第一个cordova项目。
After installing globally Cordova and creting a first app repository am trying to set up the android platform within this command: 在全局安装Cordova并创建第一个应用程序存储库后,尝试在此命令中设置android平台:
cordova platform add android --save 科尔多瓦平台添加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 总时间:0.989秒未能安装“ cordova-plugin-whitelist”:错误:/ home / firas / Bureau / Cordova / HelloWorld / HelloWorld / platforms / android / gradlew:命令失败,退出代码为ChildProcess.whenDone(/ home /firas/Bureau/Cordova/HelloWorld/HelloWorld/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)在ChildProcess.emit(events)上的generateTwo(events.js:87:13) .js:172:7)位于Process.ChildProcess._handle.onexit(internal / child_process.js:211:5)可能接近(内部/child_process.js:821:16)错误:/ home / firas / Bureau / Cordova / HelloWorld / HelloWorld / platforms / android / gradlew:命令失败,退出代码为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 ) 我试图删除并重新添加adroid平台,但是问题仍然存在,我也试图安装白名单插件(cordova插件添加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 但是我也遇到了同样的问题,并且由于无法构建或运行我的第一个HelloWord应用程序而结束
This issue appears especially with Cordova 6.4.0 (latest until 31 December 2016) . 此问题在Cordova 6.4.0(最新至2016年12月31日)中尤其明显。
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. 要解决此问题,只需卸载Cordova并将其重新安装到6.0.0版本即可,该版本为白名单组件提供了更高的稳定性。
Steps: 脚步:
npm uninstall -g cordova
npm install -g cordova@6.0.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.