ant 调试和 sdk.dir [英] ant debug, and sdk.dir

查看:42
本文介绍了ant 调试和 sdk.dir的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在生成 Android APK 文件时遇到问题.

当我运行 ant debug 编译工作正常,但当我运行 ant debug

我有以下错误:

iMac:proj.android smartmind$ 蚂蚁调试构建文件:/Users/smartmind/Works/Smallthing/cocos2d-x/samples/HelloCpp/proj.android/build.xml构建失败/Users/smartmind/Works/Smallthing/cocos2d-x/samples/HelloCpp/proj.android/build.xml:46: sdk.dir 丢失.确保使用 'android update project' 生成 local.properties 或通过 env var 注入它总时间:0秒

我不知道是什么问题.

解决方案

你的项目应该有一个 local.properties 文件,其中有一个 sdk.dir 行,指向哪里您的 Android SDK 已安装:

# 这个文件是Android Tools 自动生成的.# 不要修改此文件——您的更改将被删除!## 这个文件必须*不*被签入版本控制系统,# 因为它包含特定于您的本地配置的信息.# SDK 的位置.这只被蚂蚁使用# 使用版本控制系统时的自定义,请阅读# 标题注释.sdk.dir=/opt/android-sdk-linux_x86

要创建此文件(如果它不存在),请运行 android update project -p ... 其中 ... 是您项目的路径.>

I have a problem to generate the Android APK file.

When I run ant debug compilation work fine, but when I run ant debug

I have following error:

iMac:proj.android smartmind$ ant debug
Buildfile: /Users/smartmind/Works/Smallthing/cocos2d-x/samples/HelloCpp/proj.android/build.xml

BUILD FAILED
/Users/smartmind/Works/Smallthing/cocos2d-x/samples/HelloCpp/proj.android/build.xml:46: sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var

Total time: 0 seconds

I don't know what is problem.

解决方案

Your project should have a local.properties file with an sdk.dir line that points to where your Android SDK is installed:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/opt/android-sdk-linux_x86

To create this file if it does not exist, run android update project -p ... where the ... is the path to your project.

这篇关于ant 调试和 sdk.dir的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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