eclipse 如何解决?“Dex Loader SecurityException:无法找到 dex.jar 的字段”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13373616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve it? "Dex Loader SecurityException: Unable to find field for dex.jar"
提问by ChangUZ
All project worked fine
所有项目运行良好
But suddenly
但突然
This problem occurs all project...
整个项目都会出现这个问题...
I can not run all project.
我无法运行所有项目。
回答by aanno
This occurs after the recent update for the Eclipse Plugin(s) for Android. In Eclipse, use Window -> Android SDK Manager, and update your Android SDK Installation. The error message will disappear when you restart eclipse.
这发生在最近更新 Eclipse Plugin(s) for Android 之后。在 Eclipse 中,使用 Window -> Android SDK Manager,并更新您的 Android SDK 安装。当您重新启动 eclipse 时,错误消息将消失。
回答by paulrehkugler
Or, if you're like me and have both Eclipse 3.7.x and Eclipse 4.2.x installed, you will need to update the Android SDK Installation on both of them if you want both of them to work (despite the fact that I used the same installation directory).
或者,如果你像我一样安装了 Eclipse 3.7.x 和 Eclipse 4.2.x,如果你想让它们都工作,你将需要更新它们的 Android SDK 安装(尽管我使用了相同的安装目录)。
Updating the Android SDK install is something of a beast in and of itself; I was having some issues installing API 17, but I found that clearing the SDK Manager cache alleviated those problems.
更新 Android SDK 安装本身就是一种野兽。我在安装 API 17 时遇到了一些问题,但我发现清除 SDK Manager 缓存可以缓解这些问题。
回答by Bamerza
I still had the issue following aanno's answer, so what I had to do after his step was to switch my workspace (File->Switch Workspace) to another folder, apply that and then immediately go back and re-select my original workspace location. Once I did that and eclipse returned, my workspace was back up and running.
在 aanno 的回答之后我仍然遇到问题,所以在他的步骤之后我必须做的是将我的工作区(文件 - >切换工作区)切换到另一个文件夹,应用它然后立即返回并重新选择我的原始工作区位置。一旦我这样做并且 eclipse 返回,我的工作区就会备份并运行。
回答by brannerchinese
The error appeared after an upgrade earlier today. There was no obvious difficulty with the upgrade.
今天早些时候升级后出现错误。升级没有明显的困难。
After many partial measures, it took the following to get the error to go away:
经过多次部分措施后,采取以下措施使错误消失:
- deleting both the Tools and current Android API installation, using the Android SDK Manager (followed by reboot);
- deleting the original directory in my filesystem containing the Android SDK files;
- downloading a fresh version of the Android SDK files (http://developer.android.com/sdk/index.html) and specifying its location in filesystem to Eclipse in Preferences=>Android;
- installing fresh versions of both the Tools and current Android API, using the Android SDK Manager (followed by reboot)
- 使用 Android SDK 管理器删除工具和当前的 Android API 安装(然后重新启动);
- 删除我的文件系统中包含 Android SDK 文件的原始目录;
- 下载新版本的 Android SDK 文件 (http://developer.android.com/sdk/index.html) 并在 Preferences=>Android 中将其在文件系统中的位置指定给 Eclipse;
- 使用 Android SDK 管理器安装工具和当前 Android API 的新版本(然后重新启动)
I wonder if there is something buggy in the regular updating protocol. If updates go wrong again, I will try this full uninstall and reinstall of the SDK files and ADT Plugin from the outset.
我想知道定期更新协议中是否有问题。如果更新再次出错,我将从一开始就尝试完全卸载并重新安装 SDK 文件和 ADT 插件。
For the record:
作为记录:
Mac OS 10.8.2 on 11-inch MacBook Air, Late 2010
Eclipse Version: Juno Service Release 1
Build id: 20121004-1855
Android tools: 21.0.0.v201210310015-519525
回答by nuala
Even reinstalling the Android Plugins for Eclipse didn't made this error go away for me.
即使为 Eclipse 重新安装 Android 插件也没有让这个错误消失。
For the record (aka what I've tried)
I've looked for a file called "find_java" in my SDK Folder but couldn't find any (OS X here). Solutions suggested by other answers modifying this file was not an option.
为了记录(也就是我尝试过的),
我在我的 SDK 文件夹中查找了一个名为“find_java”的文件,但找不到任何文件(此处为 OS X)。修改此文件的其他答案建议的解决方案不是一个选项。
I've also uninstalled Eclipse Plugins (using Eclipse Juno) via About eclipse > Installation Details
. Also I've tried to remove possible remaining files for this I removed these files/folders:
我还通过About eclipse > Installation Details
. 此外,我尝试删除可能的剩余文件,为此我删除了这些文件/文件夹:
/path_to_eclipse/features/com.android.*
(found 4 folders in total e.g. com.android.ide.eclipse.adt_16.0.1.v201112150204-238534)/path_to_eclipse/plugins/com.android.
(found 4*.jar
e.g. com.android.ide.eclipse.ddms_16.0.1.v201112150204-238534)
/path_to_eclipse/features/com.android.*
(共找到 4 个文件夹,例如 com.android.ide.eclipse.adt_16.0.1.v201112150204-238534)/path_to_eclipse/plugins/com.android.
(找到 4 个,*.jar
例如 com.android.ide.eclipse.ddms_16.0.1.v201112150204-238534)
I then reinstalled the plugins from inside Eclipse via Help > Install New Software
following the usual process.
然后我Help > Install New Software
按照通常的过程从 Eclipse 内部重新安装了插件。
Note: Starting the Android SDK Manager from within Eclipse I got informed my software is up to date!
注意:从 Eclipse 中启动 Android SDK 管理器时,我被告知我的软件是最新的!
Solution (?)
With installed Eclipse Plugins I downloaded the SDK from dev.android.com, unzipped to a nice location (near the beach of you ask me ^^) and referenced it from within Eclipse: Eclipse > Settings > Android > SDK Location
.
It seems the dex.jar
error moved away after this (consisstent even after restarting Eclipse).
解决方案 (?)
安装了 Eclipse 插件后,我从dev.android.com下载了 SDK ,解压到一个不错的位置(靠近你问我的海滩 ^^)并从 Eclipse 中引用它:Eclipse > Settings > Android > SDK Location
。在此之后错误
似乎dex.jar
消失了(即使在重新启动 Eclipse 后也保持一致)。
However currently my open projects are Unable to resolve target 'android-XX'
(X generic version number).
但是目前我打开的项目是Unable to resolve target 'android-XX'
(X 通用版本号)。
Once again I had a look in the Android SDK Manager and yup - now it's listing a lot of plugins as uninstalled so currently I'm re-installing the API for various Android level.
我再次查看了 Android SDK 管理器,是的 - 现在它列出了许多已卸载的插件,因此目前我正在为各种 Android 级别重新安装 API。
Will keep this post updated but it seems that downloading and manual referencing the SDK did the trick.
将保持这篇文章的更新,但似乎下载和手动引用 SDK 做到了这一点。