为什么我更新的 Eclipse/Android 设置不再构建我的 APK?

发布于 2024-12-14 11:47:44 字数 326 浏览 6 评论 0原文

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

对于不同的项目,我认为我需要将 SDK 升级到最新、最好的版本 - 此时为 API 14 (ICS 4.0)。

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

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

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

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.

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

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.

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薄荷→糖丶微凉 2024-12-21 11:47:44

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

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

对于我个人来说,最大的问题似乎解决如下(来自论坛帖子中评论 25 的 qutoe)
“我似乎解决了在使用运行/调试之前不会自动构建 .apk 文件的问题(注释 #10、#11 等)。转到 Windows -> 首选项 -> Android -> 构建并取消选中”跳过打包和解压缩,直到导出或启动“然后重新启动 Eclipse。对我有用。”

但那里还有其他有用的材料。从事不同项目的不同人似乎对此设置有不同的问题。

我仍然不明白类路径的变化,但这似乎并不重要。

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

Eclipse Indigo - 无法安装 Android ADT 插件

我还发现,我猜由于各种卸载/重新安装,由于某种原因,它停止从来源。这篇 Stackoverflow 帖子对此很有帮助:

为什么 Eclipse 试图将我的 .svn 文件夹从 src 复制到 bin,我怎样才能让它停止?

最后:一个真正的提示卸载 Eclipse - 每个人都说没有卸载,实际上没有,但是 Eclipse 在您的主目录中留下了一个名为 .eclipse 的目录(在 Windows 7 中位于 c:\users\ 下) -
如果你真的想重新开始,就取消它。

另外,对于不太极端的措施,Eclipse 内部有 Project->Clean,您可以使用“eclipse -clean”调用 eclipse 以获得额外的清理效果。不知道是什么,但一路上各种乐于助人的人建议尝试这样做来解决问题。

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

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

对我来说,有效的方法就是转到“项目”、“属性”、“Java 编译器”,然后单击“配置工作区设置”,然后单击对话框中的“确定”。实际上不需要改变任何东西。只是表明一切正常!

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

我希望这可以节省一些人在让我的构建恢复原状所花费的时间。

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

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.

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

Eclipse Indigo - Cannot install Android ADT Plugin

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:

Why is eclipse trying to copy my .svn folders from src to bin, and how can I make it stop?

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.

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.

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

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!

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文