eyal
eyal

Reputation: 2409

Ant failed to build

I have build a Java appliction which is using ant.jar (ant 1.8.2) classes for building android application from it's build.xml file with release as target. My Android project has been built by using android create project command, using sdk 2.2. When I run my application for building the Android application I get the following message -

build.xml:46: taskdef class com.android.ant.SetupTask cannot be found

I have verified the sdk.dir path and the sdk-location path and both are correct.

How it can be solved?

Thanks, Eyal.

Upvotes: 5

Views: 12600

Answers (4)

Valdez V.
Valdez V.

Reputation: 262

In a Windows Vista box, I solved that by updating the following line in the "build.properties" file located at zxing root directory:

android-home=[YOUR PATH HERE]

...after that one, I had another error about "proguard.jar", which I also had to point to the correct location:

proguard-jar=C:\android_sdk\tools\proguard\lib\proguard.jar

After that I managed to compile further.

Upvotes: 0

Nick Burton
Nick Burton

Reputation: 41

I had this problem and realised the build.xml file was old. Try creating a new project and make sure you've got the most up-to-date build.xml file (with the new imports, etc). Good luck.

Upvotes: 0

trojanfoe
trojanfoe

Reputation: 122458

You need to update the project:

android update project --path .

Upvotes: 17

jamesmortensen
jamesmortensen

Reputation: 34078

Have you verified that the com.android.ant.SetupTask class is indeed in the sdk.dir and sdk-location path that you define?

If on Linux, the following command, run at the root of those directories, can tell you if the class is found by looking in all class and JAR files:

   grep -ri "com.android.ant.SetupTask" *

Upvotes: 1

Related Questions