Android ADT 更新后每个项目都会报错

发布于 2024-12-17 02:21:29 字数 579 浏览 0 评论 0原文

我更新到了最新的 Android ADT,现在工作区中的每个项目都显示错误,尽管实际文件中没有任何错误。即使是一个干净的 Android 项目也会说错误,尽管我已经仔细检查了所有首选项,并且我已经多次调查了每个可能的帮助论坛,但还没有找到任何修复。

我收到了许多随机错误消息,这里只是其中一些:“当前文件与给定的配置不匹配。”,“转换为 Dalvik 格式失败,错误 1”(不再是),“无效的首选项页面路径:XML语法”,“无法加载项目 * 的属性文件”等。

我的所有项目在更新之前都可以工作。

以下均无效: 清理项目,删除项目并再次导入,删除库和临时文件并修复项目属性,取消选中 Is Library,更新 ProGruad,更新 Eclipse,将 Eclipse 移至 C:\Eclipse,更改 API 级别和支持的 Android 版本以及等等...

我已经与这个问题斗争了一段时间了。

编辑: 以下操作也不起作用: 删除 LibraryName_src 文件(我的项目没有)。

编辑: 我取消选中常规首选项中的一个复选框,这使得 Eclipse 延迟打包(稍后我将检查该复选框的名称),当前错误消失了,但现在它说“找不到 *.apk!”

I updated to the newest Android ADT and now every project in my workspace says error though there isn't any in the actual files. Even a clean Android project says error even though I have double checked all the preferences and I haven't found any fixes though I have investigated every possible help forum many times.

I have gotten many random error messages and here are just a few: "Current file is not a match for the given config.", "Conversion to Dalvik format failed with error 1" (not anymore), "Invalid preference page path: XML Syntax", "Failed to load properties file for project *" etc.

All my projects worked before updating.

None of the following works:
Cleaning the project, deleting the project and importing again, deleting libraries and temporary files and fixing project properties, unchecking the Is Library, updating the ProGruad, updating the Eclipse, moving Eclipse to C:\Eclipse, changing API levels and supported Android versions and so on...

I have fought with this problem for some time now.

EDIT:
The following things don't work either: Removing LibraryName_src files (my project has none).

EDIT:
I unchecked a checkbox in the general preferences which made Eclipse to delay the packing (I'll check the name of that checkbox later) and the current errors went away but now it says that "Could not find *.apk!"

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

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

发布评论

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

评论(5

瞳孔里扚悲伤 2024-12-24 02:21:30

因此,如果有人在最​​新的 ADT 插件修订版 22 之后一直在努力解决这个问题。

请务必安装最新的平台工具。

要做到这一点

转到 C:{Android SDK 位置}\android\SDK Manager

并安装缺少的软件包

So if anyone is has been struggling with this after the latest ADT Plugin revision 22.

Be sure to install the Latest platform-tools as well.

To do this

Go to C:{Android SDK Location}\android\SDK Manager

And install the missing packages

云淡月浅 2024-12-24 02:21:29

更新 ADT 插件后我也遇到了奇怪的错误。
我通过执行 Android 清除解决了这个问题。

为此,只需右键单击您的 Android 项目即可:

- Android tools
- Clear Lint Markers

它非常适合我。

I had weird errors too after updating my ADT plugin.
I solved it by performing an Android clear.

To do so just right click on yout Android project:

- Android tools
- Clear Lint Markers

It worked perfectly for me.

白云悠悠 2024-12-24 02:21:29

最近有类似的问题。试试这个:

最近更新 Eclipse 的 ADT 后出现问题:

  • 在您的应用程序项目中,检查是否有任何指向您的库项目的链接源文件夹(它们的名称格式为“LibraryName_src”)。
  • 选择所有这些项目,右键单击,选择“构建路径”->“从构建路径中删除”。
  • 选择“同时取消文件夹与项目的链接”,然后单击“是”。
  • 清理、重建和重新部署项目。

原因似乎是某些以前版本的 ADT 将 Library 项目源文件夹链接到“子”项目,而当前的 ADT/Dex 组合不再与该解决方案兼容。

(此处找到的解决方案:“转换为 Dalvik 格式失败,外部 JAR 上出现错误 1”

Recently had a similar problem. Try this:

Problem after recently after updating the ADT for Eclipse:

  • In your app project, check for any linked source folders pointing to your library projects (they have names in the form "LibraryName_src").
  • Select all those projects, right-click, choose "Build Path"->"Remove from Build Path".
  • Choose "Also unlink the folder from the project", and click "Yes".
  • Clean, rebuild and redeploy the project.

It seems the reason is that some previous version of ADT linked Library project source folders to the "child" projects, and the current ADT/Dex combination isn't compatible with that solution anymore.

(Solution found here: "Conversion to Dalvik format failed with error 1" on external JAR)

我的奇迹 2024-12-24 02:21:29

我解决了!

我从 ADT 13 到 15 的跳跃太大了。我备份了我的工作区,删除了与 android 相关的所有内容,并安装了全新的 SDK 和 Eclipse。

之后我仍然遇到错误,但删除 debug.keystore 将其删除。

I solved it!

My jump from ADT 13 to 15 was too big. I backed up my workspace, removed everything releated to android and made a totally new SDK and Eclipse install.

After that I still got an error but deleting debug.keystore removed it.

无力看清 2024-12-24 02:21:29

我使用 Eclipse Indigo(版本 3.7)并将 CDT(而不是 ADT)插件更新到最新版本(cdt-master-8.0.1.zip)。在更新之前,我对所有正在运行的现有项目都遇到了相同的构建路径问题。我面临的问题有两个:

  1. 所有项目都缺少所需的源库链接。
  2. 我在 Eclipse 设置中丢失了默认的 Android SDK 位置。

以下是我修复这两个问题的方法:

对于问题#1:

  • 在 Eclipse 中,单击“问题”选项卡以显示构建错误列表。
  • 查找指示未找到某个类的错误。例如:“ClassABC 无法解析”
  • 双击该错误行将显示包含有问题的行的源代码,并在该有问题的行的左边缘有一个红点 x 标记。
  • 双击红点 x 标记将显示建议解决方案列表。建议列表的底部是“修复项目设置...”项目。
  • 双击“Fix project setup...”会提示您添加当前项目所需的链接源库。只需将缺少的库添加到项目构建路径中,然后单击“确定”即可。
  • 现在,如果没有其他原因导致错误,执行“刷新”、“清理”和“构建项目”应该会给你一个清晰的构建。

对于问题 #2:

  • 在 Eclipse 中,从菜单栏中选择“Window/Preferences…”,然后输入缺少的 Android SDK 位置。单击“确定”按钮。就是这样。

这两个步骤基本上使我的所有项目恢复到正常状态。

I used Eclipse Indigo (version 3.7) and updated the CDT (instead of ADT) plugin to the latest version (cdt-master-8.0.1.zip). I experienced the same build path issues for all the existing projects that were working before I did the update. The issues that I faced were two folds:

  1. The required source library link is missing from all the projects.
  2. I lost my default Android SDK location in the Eclipse settings.

Here is how I fixed these two problems:

For Problem #1:

  • In Eclipse, click on the “Problems” tab to show the list of build errors.
  • Find an error that indicates certain class is not found. For example: “ClassABC cannot be resolved”
  • Double click on that error line would bring up the source code with the offending line, with a red dot x mark on the left edge of that offending line.
  • Double click on that red dot x mark would bring up a list of suggested solutions. At the bottom of the suggested list is the item of “Fix project setup…”.
  • Double click on the “Fix project setup…” would prompt you to add the link source library that is needed for the current project. Simply add that missing library to the project build path and click OK.
  • Now, do a “Refresh”, “Clean” and “Build Project” should give you a clear build, if nothing else causes errors.

For Problem #2:

  • In Eclipse, select from the menu bar “Window/Preferences…”, and then enter the missing Android SDK location. Click on OK button. That’s it.

These two steps basically restore all of my projects to the normal condition.

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