【发布时间】:2021-01-17 18:38:44
【问题描述】:
无法让ionic cordova build android 工作。
信息:
- ubuntu 20..,
- 节点 10,离子 5,
- 局部角度 8,
- 5 级,
- android sdk 28、30。
- 所有变量都被导出...据我所知
FIRST: 在 npm install 和 global ionic、cordova 和 angular install 之后,我运行命令 ionic cordova build android。我在输出中收到此错误:
...
ember-cli:testing cli: command.validateAndRun +1ms
The specified command run is invalid. For available options, see `ng help`.
[ERROR] An error occurred while running subprocess ng.
ng run app:ionic-cordova-build --platform=android exited with exit code 1.
SECOND : 运行 ng run app:ionic-cordova-build --platform=android 时解决没有错误,即使它在运行 'ionic cordova build android' 时“以退出代码 1 退出”
第三次: 运行 ng run app:ionic-cordova-build --platform=android 后,我运行 ionic cordova build android 并得到了这个结果,但构建文件夹中没有 apk:
...
BUILD SUCCESSFUL in 23s
42 actionable tasks: 42 executed
Command finished with error code 0: /home/art/Documents/obc/platforms/android/gradlew cdvBuildDebug,-b,/home/art/Documents/obc/platforms/android/build.gradle
Built the following apk(s):
/home/art/Documents/obc/platforms/android/app/build/outputs/apk/debug/app-debug.apk
No scripts found for hook "after_compile".
No scripts found for hook "after_build".
art@pop-os:~/Documents/obc$
在运行ionic cordova build android 之前我是否遗漏了一些步骤?
有没有办法强制它运行脚本完成?
是否需要在 package.json 文件中添加“after_compile”、“after_build”脚本?
【问题讨论】:
-
没有你的
package.json,你很难用失败的命令ionic cordova build android来支持你。请将其添加到您的帖子中。
标签: android angular cordova ionic-framework ionic5