为什么我更新的 Eclipse/Android 设置不再构建我的 APK? [英] Why is my updated Eclipse / Android setup not building my APK anymore?

查看:25
本文介绍了为什么我更新的 Eclipse/Android 设置不再构建我的 APK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 3.6.2 和版本 11 的 SDK 工具进行了有效的 Eclipse 设置,并且它构建我的主要项目已经有一段时间了.

I had a working Eclipse setup with 3.6.2 and SDK tools from version 11, and it has been building my main project just fine for quite a while.

对于一个不同的项目,我认为我需要将我的 SDK 升级到最新最好的 - 现在是 API 14 (ICS 4.0).

For a different project, I thought I needed to upgrade my SDK to the latest and greatest - at this point API 14 (ICS 4.0).

我什至无法重建我所经历的步骤,但发生的事情是我的项目似乎可以构建,但我会看到它会说它正在跳过编译后步骤,最后我会没有APK.

I cannot even reconstruct the steps I went through, but what happened was that my project would seem to build, but I would see that it would say that it was skipping a post-compiler step, and at the end I would have no APK.

我还注意到它更新了我的 .classpath 以便输出路径是 bin/classes 而不是 .bin.

I also noticed that it updated my .classpath so that the output path was bin/classes instead of .bin.

在此过程中,我尝试将 Eclipse 更新到最新版本(Indigo 3.7.1),但这没有帮助.

Along the way I tried updating my Eclipse to the latest version (Indigo 3.7.1) but this didn't help.

推荐答案

我最终在 Google Android 论坛上的这篇帖子的帮助下解决了这个问题:

I solved the problem eventually with help from this post on the Google Android forum:

http://code.google.com/p/android/issues/detail?id=21031

就我个人而言,最大的问题似乎解决如下(引用自论坛帖子中的评论 25)我似乎解决了在使用运行/调试之前不会自动构建 .apk 文件的问题(评论 #10、#11 等).转到 Windows -> Preferences -> Android -> Build 并取消选中Skip Packaging anddexing 直到导出或启动"然后重新启动 Eclipse.对我有用."

For me personally the biggest issue seemed to be solved as follows (qutoe from comment 25 in the forum post) "I seem to solve the problem with .apk files not being built automatically until run/debug is used (comments #10, #11 etc.). Go to Windows -> Preferences -> Android -> Build and uncheck "Skip packaging and dexing until export or launch" then restart Eclipse. Works for me."

但是那里还有其他有用的材料.不同项目的不同人似乎对这种设置有不同的问题.

But there is other useful material there. Different people with different projects seem to have different problems with this setup.

我仍然不明白类路径的变化,但似乎无关紧要.

I still don't understand the change in the classpath, but it doesn't seem to matter.

此外,我在 Stackoverflow 中找到了关于使用 Eclipse Indigo 安装 ADT 的讨论,这对我很有帮助:

In addition, I found a discussion of installing the ADT with Eclipse Indigo which was helpful here in Stackoverflow:

Eclipse Indigo - 无法安装 Android ADT 插件

我还发现我猜是由于各种卸载/重新安装,出于某种原因它停止从源中排除我的 .svn 目录.这篇 Stackoverflow 帖子对此很有帮助:

I also found that I guess because of various uninstalls/reinstalls, for some reason it stopped excluding my .svn directories from the sources. This Stackoverflow post was helpful with that:

为什么 Eclipse 试图将我的 .svn 文件夹从 src 复制到 bin,我该如何让它停止?

最后:真正真正卸载 Eclipse 的提示 - 每个人都说没有卸载,也没有,但是 Eclipse 会在您的主目录中留下一个目录(在 Windows 7 中的 c:\users\ 下)称为 .eclipse -如果您真的想重新开始,请关闭它.

Finally: a tip for really and truly uninstalling Eclipse - everybody says there is no uninstall, and there isn't, but there is a directory that Eclipse leaves in your home directory (in windows 7 under c:\users\) called .eclipse - Zap it if you really want to start fresh.

此外,对于不太极端的措施,Eclipse 内部有 Project->Clean,您可以使用eclipse -clean"调用 eclipse 以获得额外的清洁效果.不知道是什么,但一路上有很多乐于助人的人建议尝试解决问题.

In addition, for less extreme measures, there is Project->Clean inside Eclipse, and you can invoke eclipse with "eclipse -clean" for additional cleansing effects. No idea what, but various helpful people along the way suggested trying that to solve problems.

是的 - 当我第一次安装 Indigo 并尝试构建时,我收到一条警告,说我的 Java 编译器合规性级别达不到要求,这根本不是真的 - 我的机器上只安装了 Java 1.6.对于有类似经历的人,请参阅此帖子:

Ah yes - when I first installed Indigo and tried to build, I got a warning that my Java Compiler Compliance level was not up to snuff, which was simply not true - I have only Java 1.6 installed on my machine. See this post for somebody who had similar experience:

http://marakana.com/forums/android/general/374.html

对我来说,只需转到项目"、属性"、Java 编译器",然后单击配置工作区设置",然后单击对话框中的确定"即可.不需要真正改变任何东西.只是表明一切正常!

For me, what worked was simply going to Project, Properties, Java Compiler, then click on Configure Workspace Settings, and click on Ok in the dialog. Didn't need to actually change anything. Just showed it that everything was ok!

最终我确实清理了我的 Eclipse 和 Android 安装(包括前面提到的 .eclipse 目录,并且在您的主目录中还有一个 .android 目录,如果卸载 Android SDK 工具没有这样做,您可能想要删除它- 这实际上是可卸载的).从头开始安装所有东西,然后使用上面提供的附加信息,现在它正在构建我的 APK.

Eventually I indeed did clean out my Eclipse and Android installations (including the aforementioned .eclipse directory, and there's also an .android directory in your home directory which you may want to erase if uninstalling the Android SDK Tools doesn't do that - this actually is uninstallable). Installed everything from scratch and then used the additional information provided above and now it's building my APK.

我希望这可以节省我花费的时间让我的构建恢复正常.

I hope this saves somebody the hours I spent getting my build back in shape.

这篇关于为什么我更新的 Eclipse/Android 设置不再构建我的 APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆