开发者

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.


You need to update the project:

android update project --path .


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" *


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜