Android ADT错误,dx.jar没有从SDK文件夹加载
我刚刚下载了 Eclipse Galileo 并安装了 ADT10,并尝试使用本指南创建一个phonegap应用程序:http://www.phonegap.com/start 但每次我尝试构建时都会收到此错误: 未知错误:无法构建:未从 SDK 文件夹加载文件 dx.jar!
我知道这个论坛中已经有一些关于它的问题/答案,但它们对我不起作用。
I just downloaded Eclipse Galileo and installed ADT10 and tried to a phonegap app using this guide: http://www.phonegap.com/start
But each time i try to build im getting this error:
Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
I know that there are already some questions/answers about it in this forum but they didnt work for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(17)
这是由于升级到最新版本不完整/混乱导致
{Android SDK dir}\platform-tools\lib\
中缺少 dx.jar。解决方案:
在
{Android SDK dir}\platforms\*
中找到最新的dx.jar并将其复制到:
{Android SDK dir}\platform-tools\ lib\
重新启动 eclipse,
clean
您的项目,一切都应该按预期工作。(如果
platform-tools\lib
目录完全丢失,您将必须使用 SDK 管理器重新安装“Android SDK platform-tools”。重新安装后 dx.jar 应该在其中,因此不需要复制)如果您在任何
{Android SDK dir}\platforms\*
子目录中都找不到dx.jar
,则必须启动 SDK 管理器并安装 Android 1.6 SDK。例如,在我的机器上,最新版本位于
{Android SDK dir}\platforms\android-4\tools\lib\
中。(截至 2012 年 1 月 22 日 Android SDK R15,我没有找到任何更新版本)。
我真的希望这对某人有用,因为我浪费了半天的时间来调查和寻找这样一个微不足道的错误的解决方案......:-(
This is caused by incomplete/messy upgrade to latest version which results in dx.jar missing from
{Android SDK dir}\platform-tools\lib\
.Solution:
Find your latest dx.jar in
{Android SDK dir}\platforms\*
and copy it to:
{Android SDK dir}\platform-tools\lib\
Restart eclipse,
clean
your project and everything should work as expected.(If
platform-tools\lib
directory is missing entirely you will have to reinstall "Android SDK platform-tools" using SDK manager. After reinstall dx.jar should be in there so no copying will be needed)If you can't find
dx.jar
in any of{Android SDK dir}\platforms\*
subdirs you will have to start SDK manager and install Android 1.6 SDK.For example on my machine latest was in
{Android SDK dir}\platforms\android-4\tools\lib\
.(I did not find any newer version as of 2012-01-22 Android SDK R15).
I really hope that this is useful for someone because I've wasted half a day investigating and looking for solution of such a trivial bug... :-(
升级后,platform-tools\lib 文件夹丢失(我的 eclipse 已打开)。
关闭eclipse,使用sdk管理器卸载并安装“Android SDK platform-tools”。
platform-tools\lib folder was missing after upgrade (my eclipse was open).
close eclipse, using sdk manager uninstall and install "Android SDK platform-tools".
我昨天刚刚在 Neon Release (4.6.0) 的 Eclipse 中遇到了同样的问题。
这是与 android-sdk“build-tools”26.0.0 相关的兼容问题。
简单解决方案:
其他解决方案:
sdk.buildtools=25.0.2
祝你好运!
I just encountered the same problem yesterday, in Eclipse of Neon Release (4.6.0).
It's a compatible issue related to 26.0.0 of android-sdk "build-tools".
Simple Solution:
Other Solution:
sdk.buildtools=25.0.2
Good luck!
自从我从 build-tools 25.0.0 升级到 26.0.0 以来,我在 Eclipse 中遇到了这个问题,
我只需在我的 project.properties 中添加“sdk.buildtools=25.0.0”,它就可以再次运行
我的项目。特性:
I had this problem in Eclipse since I upgraded from build-tools 25.0.0 to 26.0.0
I just add "sdk.buildtools=25.0.0" in my project.properties and it works again
my project.properties:
我在 Mac OS 10.12.4 上运行 Eclipse Neon.2 和 Android SDK Build-tools + platform-tools 版本 26,上述答案(包括已接受的答案)都不适合我。
所做的工作是
退出 Eclipse
删除文件夹
/build-tools/26.0.0
并通过 Android SDK 管理器安装(旧)版本 25.0.3 的构建工具。再次启动 Eclipse
I was running Eclipse Neon.2 and the Android SDK Build-tools + platform-tools version 26 on Mac OS 10.12.4 and none of the above answers (including the accepted answer) worked for me.
What did work was to
Quit Eclipse
Remove the folder
<android-sdk>/build-tools/26.0.0
and to install the (older) version 25.0.3 of the build tools through the Android SDK manager.Start Eclipse again
我也遇到过这种情况,而且出现这种情况是因为我已经换成win7了,并且安装了最新的ADT到eclipse,但是我用的是我的旧的Android SDK。最后,我通过将 Android SDK 更新到最新版本来解决此问题。
It happened to me, either, and it happens because I've changed to win7, and install the latest ADT to eclipse, but I used my old Android SDK. Finally, I fix this problem by updating my Android SDK to the latest version.
对我来说,Eclipse 在错误的位置寻找 SDK 管理器。为了解决这个问题,我做了
注意:SDK 管理器会告诉您它在 UI 顶部附近使用的目录。
我已经安装了新版本的 eclipse,它从 Android 开发者网站,但是当我打开 eclipse 时,它正在查看旧的 SDK.exe 位置。
哈
For me, eclipse was looking in the wrong place for the SDK Manager. To fix this I did
NOTE: The SDK manager tells you what dir it is using near the top of the UI.
I had installed a new version of eclipse that has the ADT bundled up from the Android developer site, but when I opened eclipse it was looking at the old SDK.exe location.
hth
我还没有看到这个具体问题,但使用 Eclipse Helios 或 Indigo 可能会得到更好的结果。 Galileo 已经过时了,不太可能像更新的 Eclipse 平台那样进行更多的测试。
I haven't seen this specific problem, but you may get better results with Eclipse Helios or Indigo. Galileo is getting old and is unlikely to be tested as much as the more recent Eclipse platforms.
有时你需要在更新后重新启动 Eclipse,它对我修复了该错误很有用
sometimes you need just to restart Eclipse after the update, it worked for me to fix that error
另外,请确保 AndroidSDKTools 支持 ADT 的版本。这解决了我的问题。在SDK管理器中,文件->重新加载将导致最新版本。
Also, make sure that the version of the ADT is supported by the AndroidSDKTools. That fixed my problem. In the SDK Manager, File->Reload will lead to the latest revisions.
尝试使用 Eclipse Indigo:http://www.eclipse.org/downloads/ 并按照以下说明进行操作如何安装 Android ADT: http://developer.android.com/sdk/eclipse- adt.html
Try using Eclipse Indigo: http://www.eclipse.org/downloads/ and follow the instructions on how to install Android ADT from: http://developer.android.com/sdk/eclipse-adt.html
Windows 7 64 位、Intel i7
在我更新 SDK 以兼容 Jelly Bean 后,我也遇到了这种情况。文件夹 platform-tools\lib 消失了。我一开始也无法在 SDK 管理器中卸载/重新安装程序工具。它给了我一个错误,即 android\temp 文件夹中的特定文件不存在。我必须更改 android 文件夹的权限以允许所有操作,这解决了问题。
Windows 7 64 bit, Intel i7
This happened to me as well after I updated the SDK to be Jelly Bean compatible. The folder platform-tools\lib was gone. I also wasn't able to uninstall/reinstall the program-tools in the SDK manager at first. It gave me the error that a particular file in the android\temp folder was not there. I had to change the permissions on the android folder to allow every action, and that solved it.
即使在我的 UBuntu-16.04 LTS 中重新安装“Android SDK platform-tools”后,问题仍然存在。
我正在使用 Eclipse-Oxygen。
将 dx.jar 从 /build-tools/25.0.3/lib 复制到 /build-tools/26.0.0-preview/lib 解决了我的问题。
Even after reinstalling "Android SDK platform-tools" in my UBuntu-16.04 LTS problem persisted.
I am using Eclipse-Oxygen.
Copying dx.jar from /build-tools/25.0.3/lib into /build-tools/26.0.0-preview/lib solved my problem.
使用 Android SDK Manager 更新 Android SDK 平台工具并重新启动 Eclipse 对我来说是这样
Updating Android SDK platform-tools with the Android SDK Manager and restarting Eclipse did it for me
如果您已更新 ADT 工具和 SDK 平台并且看到上述错误,请重新启动 Eclipse。
If you have updated the ADT tools and also SDK platform and you see the above error, restart Eclipse.
将更新后的 Android SDK 解压缩到当前 SDK 文件夹中。这解决了我的问题。
Unzip the updated Android SDK in your current SDK folder. This solved my problem.
是有用的
对我来说,删除
"build-tools"
目录中的"26.0.0"
请改用“
25.0.2”
重新启动日食
It's work for me do this
Delete
"26.0.0"
in"build-tools"
directoryUse "
25.0.2"
insteadRestart eclipse