Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create build.xml for an Android project? [duplicate]

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).

like image 683
JB_User Avatar asked Mar 30 '13 13:03

JB_User


People also ask

What is build XML in Android?

Apache ANT is tool to automate build of java projects ,by providing instructions in build. xml file ,eclipse uses ant to build projects . I suggest Android Studio as IDE which uses Gradle for build of android project and that is officially supported by google.

How do I insert one XML file into another Android?

Probably you will have to set within the include tag the properties that sets where it has to be placed: android:layout_above, android:layout_toLeftOf, etc... Use fill_parent instead. I pasted my code and I am working with honeycomb, thats why I was using match_parent. But it should work with fill_parent.

How do I create an XML file on my phone?

File newxmlfile = new File("/data/new. xml"); You could save it to the internal storage, or cache.


1 Answers

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.

like image 181
CommonsWare Avatar answered Oct 21 '22 13:10

CommonsWare