cordova - 错误运行子进程cordova时发生错误

标签 cordova ionic-framework firebase-realtime-database ionic3 ionic4

我已经完成了一个项目,我想构建一个apk。我已经尝试构建它,但是在编写构建它的句子之后,第三个代码给了我一个错误。
这里我写的代码或语句来构建它。

ionic cordova platform remove android
ionic cordova plarform add android@6.4.0
ionic cordova build android

3 天前,我按照上面编写的代码构建了一个项目。这里的错误。 (这次我连接了firebase)
Platform android already added.
[ERROR] An error occurred while running subprocess cordova.

        cordova platform add android@6.4.0 --save exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

E:\ionic\notasFirebase>ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
[19:08:57]  ionic-app-scripts 3.2.0
[19:08:57]  build dev started ...
[19:08:57]  clean started ...
[19:08:57]  clean finished in 13 ms
[19:08:57]  copy started ...
[19:08:57]  deeplinks started ...
[19:08:57]  deeplinks finished in 61 ms
[19:08:57]  transpile started ...
[19:09:03]  transpile finished in 6.09 s
[19:09:03]  preprocess started ...
[19:09:03]  preprocess finished in 1 ms
[19:09:03]  webpack started ...
[19:09:03]  copy finished in 6.41 s
[19:09:11]  webpack finished in 8.34 s
[19:09:11]  sass started ...
[19:09:13]  sass finished in 1.66 s
[19:09:13]  postprocess started ...
[19:09:13]  postprocess finished in 29 ms
[19:09:13]  lint started ...
[19:09:13]  build dev finished in 16.44 s
[19:09:19]  lint finished in 6.02 s
> cordova build android
Unable to load PlatformApi from platform. Error: Cannot find module 'E:\ionic\notasFirebase\platforms\android\cordova\Api.js'
Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.)

最佳答案

请试试这个命令,它在我的项目中工作。

npm i cordova-res

关于cordova - 错误运行子进程cordova时发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52805157/

相关文章:

cordova - 代码推送 : Where to find Deployment Key for Visual Studio project

iphone - PhoneGap : download & save binary files (mp3s) for iPhone & Android

javascript - Ionic 和 angularjs 嵌套步骤应用程序

android - 无法正确编码 firebase 值

android - Firebase 写入权限被拒绝

android - Phone Gap + native 插件中视频捕获的局限性

cordova - Phonegap 网络状态

javascript - Ionic + Cordova InappBrowser - 输入类型=文件不工作

php - 从 php 向 Android 应用程序发送推送通知

swift/火力地堡 : How do I properly store a Facebook user into Firebase database when they create an account?