0

I am trying to run a test and get coverage for an Android application I developed, and because this is for research purposes, I would also like to be able get coverage for the Android source code being call as well as coverage for my application under test. I followed some advice on another question I asked and am currently trying to use Ant.

I ran

ant emma debug install test

in my test but it gave me the following error:

BUILD FAILED
/scratch/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

I went online and installed the latest version of Ant directly from the Apache website, but now I've realized that I need to upgrade the version of Ant in the SDK directory. I haven't just simply copy and pasted because I had a feeling that would mess up with the paths in the configuration that are probably called when commands such as above are called.

What I want to know is if there is a way to update specifically the version of Ant contained in the Android SDK?

Thanks.

EDIT: I tried changing the Ant classpath in Eclipse Juno to where I stored a version of Ant 1.8.4. However, I still get the error that the current version 1.7.1. At this point, I'm sure that I need to probably change settings somewhere in Eclipse for this to work, but how?

Community
  • 1
  • 1
NioShobu
  • 775
  • 2
  • 10
  • 21

1 Answers1

0

I am not sure, if we just use different SDKs, but my android SDK doesn't contain any ant itself :)

Just some ant build files, but the normal ant installed is used. So I would assume, that you did something wrong, with upgrading ant. If you enter in your console ant -v it should print out the version. As long as this version isn't larger or equal than 1.8.0, something with the upgrade has gone wrong.

Tim Roes
  • 1,406
  • 1
  • 12
  • 22
  • Okay, I'm a little confused. I am running ant through the the build files I made through android. I installed Apache Ant separately, although there is a build.xml and NOTICE.txt file in android-sdk-linux/tools/ant, which is what I assume android uses by default (especially since when I ran `ant -v` it resulted in version 1.7.1 (although apparently the build file doesn't exist now?)). Can I get it to use the Ant version I just installed separately? – NioShobu Jul 27 '12 at 21:57
  • Never mind about the build.xml. I didn't run it in the test project I put build.xml. Would I need that file in the application under test as well? – NioShobu Jul 27 '12 at 22:03
  • The problem is, that your update of ant somehow didn't work. Could you tell us, what operating system you use? – Tim Roes Jul 27 '12 at 22:05
  • 1
    Isn't there an 1.8.0 ant version in your package management? If not and you unzipped it from apache somewhere else, you must make sure, that you really use it. What means, if there still is another `ant` in your PATH (that is looked up for the commands you type) make sure, you will use the whole path where you unpacked the downloaded `ant`. It might then look like `/full/path/to/apache/ant emma debug install test`. You can try that also with `/full/path/to/apache/ant -v` to see, that it really works, and took the right version. – Tim Roes Jul 27 '12 at 22:31
  • I did that, although it still tells me that it's Ant version 1.7.1, although I know what I installed was version 1.8.4 (or should have, anyway). – NioShobu Jul 27 '12 at 22:36