简体   繁体   English

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

[英]ERROR An error occurred while running subprocess cordova

I have finished a project, and I would like to build an apk.我已经完成了一个项目,我想构建一个 apk。 I have tried to build it, but after writing the sentences to build it, the third code gave me an error.我已经尝试构建它,但是在编写了构建它的语句之后,第三个代码给了我一个错误。 Here the code or sentences I wrote to be built it.这里用我写的代码或语句来构建它。

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

I have built a project 3 day ago following the code I wrode above.我在 3 天前按照上面写的代码构建了一个项目。 Here the error.这里的错误。 ( this time I connect with firebase) (这次我连接的是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

I used this method for Windows 10, the problem was fixed我在 Windows 10 上使用了此方法,问题已解决

在此处输入图片说明

sdkmanager.bat --licenses

I installed it我安装了

错误运行子进程cordova时发生错误,这可能是由于多种原因引起的请检查天气package.json文件中的所有插件是否加载正确如果其中任何一个已被弃用或存在任何没有用但在package.json中的额外插件删除它并构建 apk 这可能会解决问题

If this is happening after connecting to firebase after Open the platform/android in android studio and in top menu under refactory->select Migrate to androidX如果在连接到 firebase 后在 android studio 中打开平台/android 并在重构下的顶部菜单中->选择迁移到 androidX 后发生这种情况

removing android platform and re-adding worked for me删除 android 平台并重新添加对我有用

I encountered this error, and I reinstalled Cordova:我遇到了这个错误,我重新安装了 Cordova:

npm uninstall -g cordova
npm install -g cordova

And it works on my side.它对我有用。 There are other reasons for this error, so I am not sure this will work on your side.这个错误还有其他原因,所以我不确定这对你有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:运行子进程cordova时发生错误 - ERROR: An error occurred while running subprocess cordova 错误 - 运行子进程cordova时发生错误 - ERROR - An error occurred while running subprocess cordova Ionic Error:运行subprocess cordova时发生错误 - Ionic Error: An error occurred while running subprocess cordova ionic cordova [ERROR] 运行子进程时发生错误 - ionic cordova [ERROR] An error occurred while running subprocess 运行子进程cordova 时出错。 为什么? - An error occurred while running subprocess cordova. Why? 离子 cordova 准备 ios 抛出错误“运行子进程 cordova 时发生错误。” - Ionic cordova prepare ios throws an error "An error occurred while running subprocess cordova." 运行子进程cordova 时出错。 cordova.cmd 平台添加 android 退出,退出代码为 1 - An error occurred while running subprocess cordova. cordova.cmd platform add android exited with exit code 1 错误 ENOENT 没有这样的文件或目录 错误 运行子进程 cordova 时发生错误 - Error ENOENT no such file or directory ERROR An error occurred while running subprocess cordova 在2秒钟内构建失败[错误]运行子进程cordova时发生错误。[cordova.cmd编译android退出,退出代码为1] - BUILD FAILED in 2s [ERROR] An error occurred while running subprocess cordova.[cordova.cmd compile android exited with exit code 1] 运行子进程cordova时出错,但没有解释 - An error while running subprocess cordova, but no explanation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM