Tag Archives: sdk

The Android Ant-based build system requires Ant 1.8.0

I’m setting up a new Ubuntu installation (Quantal Quetzal) and I’m going to play with some Android code on it.

The first test I did after installing the Android SDK gave me this result:

/home/max/AndroidSDK/android-sdk-linux/tools/ant/build.xml:377: The Android Ant-based build system requires Ant 1.8.0 or later. Current version is 1.7.1

This is not what I needed, but fortunately the solution is easy enough.
Doing something like this solved my issue:

root@praxi:~# aptitude install ant=1.8.2-4build2



How to compile Android SDK samples

Recently I came across a Stackoverflow question about sample code in Android SDK.
The user was asking how to import code in an Eclipse project.

I’m not using Eclipse in my Android projects so I answered with command line instructions. My development environment is based on vim and bash.

My answer was a bit off topic, but can be useful to someone else.

Let’s presume you want to compile LunarLander sample.
You need to copy the directory recursively to a new path and work on it with the android command:
$ cp -r $ANDROID_SDK/samples/android-15/LunarLander .
$ android update project --path LunarLander/ --target 3 --subprojects
$ cd LunarLander/
$ ant debug install

You have to check the targets available to your system with the following command:
$ android list targets