简体   繁体   English

Phonegap / Cordova建筑APK退出代码1?

[英]Phonegap/Cordova building APK exit code 1?

Ive finnished a final year project using phonegap on OSX and i want to make a APK for user testing. Ive在OSX上使用phonegap完成了最后一个项目,我想制作一个APK供用户测试。

When i've been testing the app on my android tablet i use 当我在Android平板电脑上测试该应用程序时,我会使用

phonegap run android // or // cordova run android

it builds and goes onto my android device fine, works properly and all the plugins work fine, however i want to be able to make its own .APK file so friends can test it and give me feedback. 它可以构建并运行到我的android设备上,可以正常工作,并且所有插件都可以正常工作,但是我希望能够制作自己的.APK文件,以便朋友可以对其进行测试并提供反馈。

I was told to use 有人告诉我使用

phonegap build android --release

When i use this command it will fall over with an exit code 1 saying i may not have the required platform or OS to build this project, despite when running the previous command it says build fine. 当我使用此命令时,它将退出,并显示退出代码1,表示我可能没有构建该项目所需的平台或操作系统,尽管在运行上一个命令时,它说生成正常。

Error code in CLI CLI中的错误代码

    BUILD FAILED

Total time: 4.202 secs

/Users/robertlemm/Development/phonegap_dev/Little_Scavngers/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                    ^
Error code 1 for command: /Users/robertlemm/Development/phonegap_dev/Little_Scavngers/platforms/android/gradlew with args: cdvBuildRelease,-b,/Users/robertlemm/Development/phonegap_dev/Little_Scavngers/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/robertlemm/Development/phonegap_dev/Little_Scavngers/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/robertlemm/Development/phonegap_dev/Little_Scavngers/platforms/android/cordova/build: Command failed with exit code 1

I've ensured android tools & platform tools are up in my $PATH, checked SDK manager to ensure ive got version 14 to latest installed, checked the Platforms.JSON file to ensure the versions are set to the minimum, the config.xml says <preference name="android-minSdkVersion" value="16" /> 我已确保$ PATH中已安装了android工具和平台工具,检查了SDK管理器以确保已将版本14安装到最新版本,并检查了Platforms.JSON文件以确保将版本设置为最低,config.xml表示<preference name="android-minSdkVersion" value="16" />

Honestly not sure how to do it 老实说不确定该怎么做

Have you tried removing and adding again the android platform? 您是否尝试过删除并再次添加android平台? I remember having this issue several times and fixing it by just doing that. 我记得曾多次遇到此问题,并仅通过这样做解决了。

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

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