Android ADT error, dx.jar was not loaded from the SDK folder

135,810

Solution 1

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... :-(

Solution 2

platform-tools\lib folder was missing after upgrade (my eclipse was open). close eclipse, using sdk manager uninstall and install "Android SDK platform-tools".

Solution 3

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:

  • Delete "26.0.0" in "build-tools" directory
  • Use "25.0.2" instead
  • Restart eclipse

Other Solution:

  • add this in the project.properties of your project:
    sdk.buildtools=25.0.2

Good luck!

Solution 4

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:

target=android-23
sdk.buildtools=25.0.0
android.library.reference.1=../design

Solution 5

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

  1. Quit Eclipse

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

  3. Start Eclipse again

Share:
135,810
Adonis K. Kakoulidis
Author by

Adonis K. Kakoulidis

Updated on July 05, 2022

Comments

  • Adonis K. Kakoulidis
    Adonis K. Kakoulidis almost 2 years

    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.

  • luben
    luben over 11 years
    Backup your original dx.jar file before making it - this solution totally broke my eclipse installation and now I will have to reinstall the whole eclipse and android environment, because of this comment that is upvoted by 39 people!
  • Ognyan
    Ognyan over 11 years
    @Lyuben Probably you did overwrite some other file(s)? If you already had dx.jar you will not get the "dx.jar was not loaded from the SDK folder" in the first place...
  • luben
    luben over 11 years
    The problem happened, because I had 2 different eclipse IDEs - Juno & Indigo. The Juno was working fine, however Indigo showed me this error with the dx.jar file. Then I copied the dx.jar as is adviced here and the Indigo eclipse was still not working. However, the Juno eclipse also stopped working at that moment :) The solution was to uninstall the ADT plugin from eclipse and download fresh new SDK and install the plugin again and point it to the new SDK directory. My first mistake was forgetting to backup the dx.jar file before copying and overwriting it.
  • Ognyan
    Ognyan over 11 years
    I see. Well, that is quite unfortunate. I will +1 your second comment in order to give some heads up to people in similar situation (i.e. 2xEclipses).
  • BluJ IT
    BluJ IT about 11 years
    I first ran into this issue when I updated Eclipse. The upgrade of Eclipse caused me to be incompatible with the SDK that I had installed. So, my next step was to download the latest release of the SDK and to install it. Installation of the SDK alone was not enough. I then had to run the Android SDK Manager, and allow it to upgrade all that it felt was necessary. Once that was done, I continued to see this issue. The last step was to restart Eclipse, and finally, the mess of errors were gone.
  • Jaime Montoya
    Jaime Montoya about 7 years
    This is where I can find the dx.jar file: C:\Users\Jaime\android-sdks\build-tools\26.0.0-preview\lib\d‌​x.jar. I know when I try to Run the project, it is trying to find dx.jar in the location where I have it. The problem is that for some reason, it is always failing to load it. I keep getting this error: "Dex Loader] Failed to load C:\Users\Jaime\android-sdks\build-tools\26.0.0-preview\lib\d‌​x.jar". I already tried from two different computers and the error is exactly the same. Any ideas?
  • FCo
    FCo about 7 years
    @JaimeMontoya I had a similar problem. I wound up just deleting the 26.0.0-preview directory completely since I was building with a different Android version anyways. That worked but I'm not sure I'd recommend that method.
  • Jaime Montoya
    Jaime Montoya about 7 years
    That sounds smart and I guess it should not break anything because as you said, you were not using that directory. I posted my solution at stackoverflow.com/questions/43009679/…, but in the first comment I also wrote for the accepted answer, you can see how that solution did not immediately work for me when I tried on another PC, so I am not sure if what helped to solve the problem really was switching down from Java 8/compiler compliance level 1.8 to Java 7/compiler compliance level 1.7.
  • Dave
    Dave almost 7 years
    I'm on Windows 10 using neon.3 and this was it for me. Thanks!
  • rsp1984
    rsp1984 over 6 years
    @Verdigrass Is this different to my proposed solution?
  • Verdigrass
    Verdigrass over 6 years
    @rsp1984 It is similar but in different versions and platforms.
  • cgv
    cgv over 6 years
    Was inspecting old Eclipse Juno projects on a newer Windows PC, this solution actually worked. Is it just missing from the current build-tools I guess?
  • Dan Dar3
    Dan Dar3 over 6 years
    You can have as many build-tools installed at the same time, for each target version you want to support. You can install 25.0.3 using ANDROID_SDK\tools\bin\sdkmanager.bat --install build-tools;25.0.3
  • Dan Dar3
    Dan Dar3 over 6 years
    You don't need to delete any build-tools (you can have multiple versions) for each target version you want to support. You can install build-tools 25.0.3 using ANDROID_SDK\tools\bin\sdkmanager.bat --install build-tools;25.0.3 - if you're targeting API 25 that is.
  • Kevin
    Kevin about 6 years
    Keep in mind the date youre having this issue!!! Previous high voted answers dont work anymore! This solution worked for me after hours!! I'm currently using now Java JDE 8.x (I had 9 but reverted; not sure if necessary now but worth mentioning). *Make sure you exit out of Eclipse->Use SDK Manager to uninstall->Physically delete any remaining folders
  • Prasad
    Prasad about 6 years
    Thanks, its really worked for my old code with old cordova version.
  • Skystrider
    Skystrider over 5 years
    Nothing I've tried is working for me. I don't have a working SDK Manager, other than using Android Studio to install the sdk tools and the platorm sdks. Android Studio doesn't understand my old eclipse project and I know nothing about gradle so I gotta use eclipse with ADT - which won't work because of this dx.jar issue. Any further ideas on where to get the proper dx.jar? I've tried uninstalling the sdk tools and platform tools from within Android studio and re-install but it doesn't help.
  • Tom
    Tom about 5 years
    I keep forgetting not to delete 25.0.3 and I always find this answer back :)
  • Verdigrass
    Verdigrass about 5 years
    @Tom Keep forgetting it and use Android Studio instead. :)
  • Tom
    Tom about 5 years
    @ Verdigrass, yep I just did that. It works great. I dunno why it took me so long to do the switch :D