问题描述
我正在设置第一个科尔多瓦项目.
I'm setting up a first cordova projecct.
在全局安装Cordova并创建第一个应用程序存储库后正在尝试在此命令中设置android平台:
After installing globally Cordova and creting a first app repositoryam trying to set up the android platform within this command:
cordova平台添加android --save
但是此操作最终会生成以下错误消息:
But this action ends up by generation this error message:
总时间:0.989秒安装失败 'cordova-plugin-whitelist':错误:/home/firas/Bureau/Cordova/HelloWorld/HelloWorld/platforms/android/gradlew: 命令失败,退出代码为1 在ChildProcess.whenDone(/home/firas/Bureau/Cordova/HelloWorld/HelloWorld/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23) 在emitTwo(events.js:87:13) 在ChildProcess.emit(events.js:172:7) 在也许关闭(internal/child_process.js:821:16) 在Process.ChildProcess._handle.onexit(internal/child_process.js:211:5)错误:/home/firas/Bureau/Cordova/HelloWorld/HelloWorld/platforms/android/gradlew: 命令失败,退出代码为1
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
我尝试删除并重新添加了adroid平台,但问题仍然存在,我也尝试安装了白名单插件(cordova插件添加[email protected])
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 [email protected] )
但是我也遇到了同样的问题,并且由于无法构建或运行我的第一个HelloWord应用而结束
but also I faced the same problem , and finish by not being able to build or run my first HelloWord app
推荐答案
此问题尤其在Cordova 6.4.0(最新至2016年12月31日)中出现.
This issue appears especially with Cordova 6.4.0 (latest until 31 December 2016) .
要解决此问题,只需卸载Cordova并将其重新安装到6.0.0版本即可,该版本为白名单组件提供了更高的稳定性.
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.
步骤:
-
npm uninstall -g cordova
-
npm install -g [email protected]
npm uninstall -g cordova
npm install -g [email protected]
这篇关于Cordova 6.4.0:Android平台安装白名单错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!