问题描述
当我尝试在Eclipse ADT上运行我的Android项目时,我在控制台中看到这一点:
[2017-03 -24 15:34:41 - Dex Loader]无法加载C:\Users\jaimemontoya\android-sdks\build-tools\26.0.0-preview\lib\dx.jar
[2017-03-24 15:34:41 - CouponClub]未知错误:无法构建:文件dx .jar没有从SDK文件夹加载。
我正在使用Eclipse Neon.2 Release(4.6.2):
这是从Android SDK Manager看到的包配置:
从该错误中我了解到,由于正在尝试从SDK文件夹中加载dx.jar,因此无法加载dx.jar。消息甚至使用感叹号来表示!它指的是什么SDK文件夹?我以为在这种情况下,C:\Users\jaimemontoya\android-sdks将被视为一个SDK文件夹。你知道在哪里可以找到dx.jar文件?
阅读
然后我从jre1.8.0_121切换到 jre7,并将编译器合规级别从1.8更改为1.7:
我的应用程序最终编译成功。
When I try to run my Android project on Eclipse ADT, I see this in the Console:
[2017-03-24 15:34:41 - Dex Loader] Failed to load C:\Users\jaimemontoya\android-sdks\build-tools\26.0.0-preview\lib\dx.jar
[2017-03-24 15:34:41 - CouponClub] Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
I am using Eclipse Neon.2 Release (4.6.2):
This is the package configuration I have as seen from the Android SDK Manager:
What I understand from that error is that it failed to load dx.jar because it is trying to load it "from the SDK folder". The message even uses an exclamation mark to say that! What SDK folder is it referring to? I thought in this case "C:\Users\jaimemontoya\android-sdks" would be considered an SDK folder. Do you know where it is expecting to find the "dx.jar" file?
Reading the accepted answer at Got "unsupported class file version 52.0" after including a module to a project gave me the hint I needed to find the solution.
I ended up with this Android SDK installation:
Then I switched from "jre1.8.0_121" to "jre7", and also changed my Compiler compliance level from "1.8" to "1.7":
My App finally compiled successfully.
这篇关于未知错误:无法构建:文件dx.jar未从SDK文件夹加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!