开发者

Latest ant in Fedora 14 is 1.7 but I need ant 1.8

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 ne开发者_如何学Goed 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)


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") '


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.


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


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜