无法在离子中添加Android平台

时间:2018-09-07 15:41:08

标签: ionic-framework ionic3

您好,只要我运行以下命令

ionic cordova platform add android

它导致以下错误:

(node:304) UnhandledPromiseRejectionWarning: CordovaError: No platforms added to this project. Please use `cordova platform add <platform>`.
at Object.preProcessOptions (C:\Users\mjdem\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\util.js:312:15)
at C:\Users\mjdem\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\run.js:30:32
at _fulfilled (C:\Users\mjdem\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\mjdem\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\mjdem\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:749:13)
at C:\Users\mjdem\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:810:14
at flush (C:\Users\mjdem\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)

(节点:304)UnhandledPromiseRejectionWarning:未处理的承诺拒绝。该错误是由于在没有catch块的情况下抛出异步函数而产生的,或者是由于拒绝 未使用.catch()处理的承诺。 (拒绝ID:1) (节点:304)[DEP0018] DeprecationWarning:已弃用未处理的承诺拒绝。将来,未处理的诺言拒绝会以以下方式终止Node.js进程:  非零退出代码。

1 个答案:

答案 0 :(得分:0)

尝试以下命令:
cordova平台添加android