5

So I run the Android SDK on my Fedora 14 PC. Before yesterday I had everything working - Ant 1.7, Eclipse 3.6.1 (Helios), and I was building my Android apps no problem.

Then I went into eclipse and installed updates. Now I'm running a newer Android SDK and it requires a later version of Ant (1.8). The latest version of ant available in Fedora 14 is Ant 1.7. I don't see a way to get back to the old sdk.

So as far as I can tell, what I need to do is remove Ant 1.7 and then manually install Ant 1.8 (and all the dependencies that go with it, see below).

If I just re-installed everything, I would end up in the same place because the Android SDK would still require Ant 1.8 and Fedora would still only offer Ant 1.7.

Has anybody else encountered or solved this problem yet? Any advice?

The hfollowing snippet shows the output of a yum remove command, which shows all the dependencies of ant which I would have to manually install:

===============================================================================
 Package                  Arch        Version              Repository     Size
===============================================================================
Removing:
 ant                      i686        1.7.1-13.fc13        @fedora       5.4 M
Removing for dependencies:
 ant-antlr                i686        1.7.1-13.fc13        @fedora        34 k
 ant-apache-bcel          i686        1.7.1-13.fc13        @fedora        34 k
 ant-apache-bsf           i686        1.7.1-13.fc13        @fedora        23 k
 ant-apache-log4j         i686        1.7.1-13.fc13        @fedora        18 k
 ant-apache-oro           i686        1.7.1-13.fc13        @fedora       169 k
 ant-apache-regexp        i686        1.7.1-13.fc13        @fedora        19 k
 ant-apache-resolver      i686        1.7.1-13.fc13        @fedora        20 k
 ant-commons-logging      i686        1.7.1-13.fc13        @fedora        23 k
 ant-commons-net          i686        1.7.1-13.fc13        @fedora       196 k
 ant-javamail             i686        1.7.1-13.fc13        @fedora        33 k
 ant-jdepend              i686        1.7.1-13.fc13        @fedora        72 k
 ant-jsch                 i686        1.7.1-13.fc13        @fedora       124 k
 ant-junit                i686        1.7.1-13.fc13        @fedora       387 k
 ant-nodeps               i686        1.7.1-13.fc13        @fedora       1.6 M
 ant-swing                i686        1.7.1-13.fc13        @fedora        35 k
 ant-trax                 i686        1.7.1-13.fc13        @fedora        95 k
 eclipse-jdt              i686        1:3.6.1-4.fc14       @updates       25 M
 eclipse-pde              i686        1:3.6.1-4.fc14       @updates       90 M
 eclipse-platform         i686        1:3.6.1-4.fc14       @updates       34 M
 jetty                    noarch      6.1.24-1.fc14        @fedora       2.7 M

Transaction Summary
===============================================================================
Remove       21 Package(s)

Error observed when trying to compile using ant:

build.xml:121: The Android Ant-based build system requires Ant 1.8.0 or later. Current version is 1.7.1

Eclipse is in a "hosed" state

An internal error occurred during: "Refreshing external folders".
java.lang.NullPointerException
java.lang.NullPointerException at org.eclipse.jdt.internal.core.ExternalFoldersManager$RefreshJob.run(ExternalFoldersManager.java:387)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
4
  • Upgrading is probably the best bet
    – Matthew
    Mar 9, 2011 at 3:09
  • I'd not mess with the vendor Ant, but install my own in /home/me/local/bin .
    – Thilo
    Mar 9, 2011 at 3:14
  • I downloaded and "installed" Ant 1.8 into /opt, but the existing ant was so woven into the existing system that I couldn't switch to the new one. That's why I sort of figure I have to completely remove Ant 1.7 to have any chance?
    – Brad Hein
    Mar 9, 2011 at 3:17
  • Hmm. There should be way to set $PATH somewhere to make the local ant take precedence.
    – Thilo
    Mar 9, 2011 at 3:27

4 Answers 4

7

You can take newest ant package from ant rpm package
Get all rpm needed and after install it with yum.
Something like:
$ wget -r -A.rpm k -nc -l1 -e robots=off http://kojipkgs.fedoraproject.org/packages/ant/1.8.2/3.fc15/noarch/
$ su -c ' yum --nogpgcheck install $(find kojipkgs.fedoraproject.org/ -name "*.rpm") '

1
  • It seems to be working! I used the build directory you provided and staged my own ant 1.8 repo with the rpms from that directory (download with wget, use createrepo to make it a repo, add it to a /etc/yum.repos.d/mynewrepo.repo, then run yum --nogpgcheck update ant). Thank you very much!
    – Brad Hein
    Mar 10, 2011 at 1:57
1

One good alternative for this on Fedora 14 is use rawhide repos and just install / update ant simply with yum. I answered your question more detailed here.

3
  • I tried that but ant 1.7 was still the latest - "yum --enablerepo=* update ant" - returned no results.
    – Brad Hein
    Mar 9, 2011 at 21:29
  • Are you sure that you have rawhide repo? Did you installed fedora-release-rawhide package (as I mentioned) before you tried enable all repos?
    – JRa
    Mar 10, 2011 at 13:22
  • Wow, it's amazing. I'm using Fedora 14 too, but I got ant 1.8.2-7 for Fedora 17 :-) Thanks JRa.
    – user942821
    Feb 8, 2012 at 15:54
0

Perhaps you could try setting Ant Home... property in Eclipse -> Window -> Preferences -> Ant -> Runtime to the ant 1.8 that you have installed.

1
  • The other 20 dependencies are what I would be worried next - that's what I mean about being woven in - it's not just ant that needs to be updated, but all the little ant plugins that go with it...
    – Brad Hein
    Mar 9, 2011 at 21:39
0

I'd previously built Android APKs with Ant 1.8.2 but only from the command line, never in Eclipse. I'm letting it import the main_rules.xml from the Android SDK, so that all the Proguard targets get included automatically. I'm running Windows not Linux and have Ant in my path.

I thought I'd see if it can be built using the Eclipse plugin. I've had success doing the following:

1) As Raghuram suggested, set the Eclipse Ant preference runtime to the folder where your 1.8 is. If you try and build an Android build.xml (imported into Eclipse) it will fail saying that it can't find the the Ant setup task.

2) I then added the AndroidSDK/tools/lib/antasks.jar into the Global entries for the classpath under the Eclipse/Preferences/Ant/Runtime preferences. The Ant view in Eclipse still says it can't find the classpath, but I ignore it and select the target and run it. It builds just fine. The only snag is that the Ant view doesn't tell me what particular build.xml it is. That might be because I don't have the project name in my build.xmls, as I have it in the build.properties file, so that I can use the same build.xml fro different projects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.