简体   繁体   English

科尔多瓦Android构建退出代码8

[英]Cordova Android Build Exit Code 8

I've been working on a Cordova project for iOS for the last couple of months, and now I want to move over and test the Android portion. 在过去的几个月中,我一直在从事iOS的Cordova项目,现在我想继续进行一下测试Android部分。 I've tried twice of installing the Android SDK, JDK, Ant, and putting them in the Path Environment Variable but I just can't get the app to build. 我已经尝试过两次安装Android SDK,JDK,Ant,并将它们放入“路径环境变量”中,但是我无法构建该应用程序。 I tried looking around at other questions but couldn't seem to find a definitive answer. 我尝试查看其他问题,但似乎找不到确切的答案。

So, when I go to build the Android platform, this is the error that I get: 因此,当我去构建Android平台时,这是我得到的错误:

BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:720: The following
error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:734: Compile failed;
see the compiler error output for details.

Total time: 3 seconds

C:\Users\thomas\Desktop\batapp\BatNetting\platforms\android\cordova\node_modules\q
\q.js:126
                throw e;
                      ^
Error code 1 for command: cmd with args: /s,/c,ant/debug/-f/C:\Users\thomas\Desktop\
batapp\BatNetting\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absoule.dir=
ant-gen
ERROR running one or more of the platforms: Error: C:\Users\thomas\Desktop\batapp\
BatNetting\platforms\android\cordova\run.bat: Command failed with exit code 8
You may not have the required environment or OS to run this project

I'm really not sure what could be causing this. 我真的不确定是什么原因造成的。 Like I said, I've tried reinstalling the SDK, Java, Ant and double checked the Path. 就像我说的那样,我尝试重新安装SDK,Java,Ant,并仔细检查了Path。 First, I tried pulling the files from a local Git server, then I removed them and copied them straight from the project I had open on the Mac VM I had been working on. 首先,我尝试从本地Git服务器中提取文件,然后将其删除,并直接从我一直在Mac VM上打开的项目中复制它们。 I have also tried using both cordova build android and ionic build android , but both have the same result. 我也尝试过使用cordova build androidionic build android ,但是结果都一样。

Any help would be greatly appreciated! 任何帮助将不胜感激!

Update 更新

I've tried creating a new app with ionic and everything in the new app works fine. 我尝试使用ionic创建一个新应用,新应用中的所有内容均正常运行。 I've successfully created a project, added Android as a platform, built and ran the Android project. 我已经成功创建了一个项目,将Android添加为平台,构建并运行了Android项目。 So, it seems to be something with the app that already exists that doesn't seem to be agreeing with me. 因此,似乎与已存在的应用程序有些不同,似乎与我不同意。

I actually figured it out. 我真的想通了。 I was just having a problem with one of my plugins. 我只是对其中一个插件有问题。 It required a java library that wasn't in my project. 它需要一个不在我的项目中的Java库。 Once I put the library in the project, it was able to build and run fine. 将库放入项目后,它便可以构建并运行良好。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM