科尔多瓦 - 机器人./create $(其中机器人)退出了1 [英] cordova-android ./create $( which android ) exited with a 1

查看:96
本文介绍了科尔多瓦 - 机器人./create $(其中机器人)退出了1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行命令创建一个项目之后...

After executing the command to create a project...

./create <PATH_TO_PROJECT_DIR> <COM_PATH> <PROJECT_NAME>

我得到的错误信息:

I get the error message:

An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...

疑难解答对策: (acconrad提供了一个聪明的清单<一href="http://stackoverflow.com/questions/13475687/cordova-2-1-0-phonegap-create-script-for-android-says-project-already-exists">here为解决科尔多瓦错误...)

Troubleshooting responses: (acconrad provided a smart checklist here for solving Cordova errors...)

你有没有从正确的位置下载正确版本的PhoneGap的?看来好像   还有的PhoneGap那不来打包版本   科尔多瓦-2.x.0.jar,这是必要的运行脚本。点击此处下载   获得PhoneGap的与正确的JAR文件。

Did you download the correct version of PhoneGap from the correct LOCATION? It appears as if there are versions of PhoneGap that do not come packaged with Cordova-2.x.0.jar, which is necessary to run the script. Download here to obtain PhoneGap with the correct JAR file.

我跟在<一的说明href="http://docs.phonegap.com/en/2.2.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android"相对=nofollow> Apache官方科​​尔多瓦API文档网站并下载科尔多瓦,机器人库从github上。官方的文档不说这个jar文件,因此我没有执行什么。

I have followed the instructions at the official Apache Cordova API Documentation site and downloaded the cordova-android repository from github. The official documentation does not say anything about this jar file and as such I have not executed it.

您已经创建的文件夹?该文件称,你   可以使用此命令,只要新的文件夹为空。这不是   真正。确保该文件夹不试图创建之前存在   项目

Did you already create the folder? The documentation claims that you can use this command as long as the new folder is blank. This is not true. Make sure the folder does not exist before attempting to create the project.

新鲜的文件夹路径,永远不会创建。

Fresh folder path, never created.

你有蚂蚁的最新版本?您将需要蚂蚁1.8.0或   更大的与Android上运行的PhoneGap。使用Ant -v以验证您   版本。

Do you have the latest version of Ant? You will need Ant 1.8.0 or greater to run PhoneGap with Android. Use ant -v to verify your version.

蚂蚁版本1.8.2,虽然运行-v标志弹出如下输出...

Ant version 1.8.2, although running the -v flag pops up the following output...

Apache Ant(TM) version 1.8.2 compiled on June 3 2011
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed

...就好像是试图建立。我认为-v表示冗长和蚂蚁正在努力打造现任董事,其中没有build.xml文件,因为我不建设一个项目,蚂蚁,只是寻找版本,这是1.8.2。

...as if it was trying to build. I assume -v means verbose and ant is trying to build the current director, in which there is no build.xml file, because I'm not building a project with ant, merely finding the version, which is 1.8.2.

是你的.bash_profile /环境变量下的路径设置是否正确?该   官方的文档已经更新,以反映这一点,但你会   绝对以创建需要这些变量设置正确   项目。

Is your .bash_profile/Environment Varibles PATH set properly? The official documentation has been updated to reflect this, but you will absolutely need these variables set correctly in order to create the project.

这两种SDK的路径已被设置和放大器; D。

Both SDK paths have been set & sourced.

你有没有更新终端,以反映新的道路?资源   或者.bash_profile中。在.bash_profile中你当前打开的终端   窗口,使你的路正在运行的创建命令时更新。

Did you update the terminal to reflect your new PATHs? source .bash_profile or . .bash_profile in your currently open terminal window so your paths are updated when running the create command.

没有重新启动,但$ PATH输出正确的Andr​​oid的SDK-MacOSX的路径(平台工具与;&放大器;工具)。

Haven't restarted but $PATH outputs the correct android-sdk-macosx paths (platform-tools && tools).

你有正确的commons- codeC?您可能会收到一个伴随   错误指的是缺少commons- codeC的文件,你可以   在这里下载。

Do you have the correct commons-codec? You may receive an accompanying error referring to a missing commons-codec file, which you can download here.

没有 commons- codeC 显示伴随的错误。

推荐答案

这个问题确实是PATH变量...

The problem was indeed the PATH variables...

/路径/要/ Android的SDK-maxosx /平台工具

/路径/要/ Android的SDK-maxosx /工具

删除从路径名的MacOSX的。

removed the macosx from the path name.

在〜/ .bash_profile中解决了这个问题,纠正这些环境变量。

Correcting these environment variables in ~/.bash_profile solved this problem.

这篇关于科尔多瓦 - 机器人./create $(其中机器人)退出了1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆