27

I've been trying to run simple programs that I obtained directly from the Source Code download for the book 'Beginning Android 4'. However, I have lots of problems with the build.xml files (see previous questions, which are unanswered). My latest is, which comes from the a simple Label demo program:

# ant debug
Buildfile: /home/me/src/ANDROID/MyProjects/Label/build.xml

BUILD FAILED
Target "debug" does not exist in the project "LabelDemo". 

I then checked with other working build.xml files and as fasr as I can tell, grepping thru the text of the file, 'debug' doesn't exist there either. But they work.

So, I obviously must be creating build.xml files incorrectly. What is the correct way to create the build file for an Android project (from the command-line).

0

1 Answer 1

66

Run android update project -p ..., where the ... is the path to the project. This will create or update the build.xml and related command-line build files. This assumes that your SDK's tools/ directory in your PATH; otherwise, you will need to fully-qualify the path to the android command.

Sign up to request clarification or add additional context in comments.

3 Comments

Cool! This worked. It also 'solved' my other problems with 'taskdef class com.android.ant.SetupTask cannot be found'.
android update project -p . --target android-19
Google decided for you, that you cannot use android command line tool anymore. Therefore this command does not work anymore. Thank you Google :(

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.