Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ant debug, and sdk.dir

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.

like image 656
lordubik Avatar asked Nov 09 '12 16:11

lordubik


1 Answers

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.

like image 86
CommonsWare Avatar answered Oct 16 '22 04:10

CommonsWare