蚂蚁没有建立在Ubuntu [英] Ant failed to build on Ubuntu

查看:198
本文介绍了蚂蚁没有建立在Ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能帮助我解决这个问题。我使用的是Ant构建编译我的java code,但我得到以下错误:

I hope someone can help me out with this problem. I am using an Ant Build to compile my java code but I get the following errors:

Buildfile: <PATH>

BUILD FAILED
<PATH>build.xml:55: sdk.dir is missing. Make sure 
    to generate local.properties using 'android update project' or to inject it
    through the ANDROID_HOME environment variable.

Total time: 345 milliseconds

我使用的日食。

I am using eclipse.

推荐答案

有两种办法可以解决这个问题,因为在错误信息说明:

There are two solutions to this problem, as described in the error message:

  1. 设置在根 local.properties 文件中的 sdk.dir 变量的值你的Andr​​oid项目的目录。这需要指向你的Andr​​oid SDK安装的位置。例如,我在我的下面一行:

  1. Set the value of the sdk.dir variable in the local.properties file in the root directory of your Android project. This needs to point to the location of your Android SDK installation. For example, I have the following line in mine:

sdk.dir =的/ usr / local / bin目录/ Android的SDK-linux的

sdk.dir=/usr/local/bin/android-sdk-linux

您可以手动或使用 Android的更新项目命令生成它。

You can do this manually or use the android update project command to generate it for you.

另外,你可以在你的主目录设置在的.bashrc 文件中的 ANDROID_HOME 环境变量。您可以通过添加类似下面的一行做到这一点:

Alternatively, you can set the ANDROID_HOME environment variable in your .bashrc file in your home directory. You can do this by adding something like the following line:

出口ANDROID_HOME =的/ usr / local / bin目录/ Android的SDK-linux的

export ANDROID_HOME=/usr/local/bin/android-sdk-linux

请注意,您需要将您的源.bashrc文件或关闭您的控制台窗口,然后重新打开它。

Note that you will need to source your .bashrc file or close your console window and reopen it.

这篇关于蚂蚁没有建立在Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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