Fedora 14中的最新蚂蚁是1.7,但我需要蚂蚁1.8

时间:2011-03-09 03:05:46

标签: android eclipse ant compilation fedora

所以我在 Fedora 14 PC上运行Android SDK。在昨天之前,我已经完成了所有工作 - Ant 1.7 Eclipse 3.6.1(Helios),我正在构建我的Android应用程序没问题。

然后我进入了eclipse并安装了更新。现在我正在运行更新的Android SDK,它需要更高版本的 Ant(1.8)。 Fedora 14 中提供的最新版本的ant是 Ant 1.7 即可。我没有办法回到旧的sdk。

据我所知,我需要做的是删除 Ant 1.7 ,然后手动安装 Ant 1.8 (以及随之而来的所有依赖项,见下文)。

如果我只是重新安装了所有内容,我最终会在同一个地方,因为Android SDK仍然需要 Ant 1.8 ,而Fedora仍然只提供 Ant 1.7

还有其他人遇到或解决了这个问题吗?有什么建议?

下面的代码片段显示了yum remove命令的输出,该命令显示了我必须手动安装的所有ant依赖项:

===============================================================================
 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)

尝试使用ant编译时出现错误:

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

Eclipse处于“软化”状态

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 个答案:

答案 0 :(得分:7)

您可以从ant rpm package获取最新的蚂蚁包 获得所需的所有转速,然后用yum安装 类似的东西:
 $ 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 :(得分:1)

Fedora 14上的一个很好的选择是使用rawhide repos,只需使用yum安装/更新ant。我更详细地回答了您的问题here

答案 2 :(得分:0)

也许您可以尝试在Eclipse中设置Ant Home...属性 - >窗口 - >偏好 - >蚂蚁 - >运行到已安装的ant 1.8。

答案 3 :(得分:0)

我之前使用Ant 1.8.2构建了Android APK,但仅限于命令行,而不是Eclipse。我让它从Android SDK导入main_rules.xml,以便自动包含所有Proguard目标。我正在运行Windows而不是Linux,并且在我的路上安装了Ant。

我以为我会看看它是否可以使用Eclipse插件构建。我做了以下成功:

1)正如Raghuram建议的那样,将Eclipse Ant首选项运行时设置为1.8所在的文件夹。如果您尝试构建一个Android build.xml(导入到Eclipse中),它将无法说它找不到Ant设置任务。

2)然后我将AndroidSDK / tools / lib / antasks.jar添加到Eclipse / Preferences / Ant / Runtime首选项下的类路径的Global条目中。 Eclipse中的Ant视图仍然表示无法找到类路径,但我忽略它并选择目标并运行它。它建立得很好。唯一的障碍是Ant视图没有告诉我它是什么特定的build.xml。这可能是因为我在build.xmls中没有项目名称,因为我在build.properties文件中有它,所以我可以在不同的项目中使用相同的build.xml。

相关问题