Tuesday, December 14, 2010

Unable to build: Could not find dx.jar file

I got to update to the latest version of the ADT tonight when I hit the weirdest error out of the blue:


Unable to build: the file dex.jar was not loaded from the SDK folder


After way too long of Googling and not coming up with an answer I finally found it on some really obscure mailing list archive site.

Solution:
Look in the project with the error and delete the default.properties file.  That is it.

Just make sure you have the latest versions of Eclipse and ADT when you do it, and that should be it.  Back to Android programming...

9 comments:

  1. I got this as well when I upgraded to the release 8 toolkit - even when creating a "Hello World" project in eclipse.

    It turned out that the way to make it go away is to navigate to windows -> preferences -> android (in eclipse)
    and you may notice that Android 2.3 is missing from the list... this is because you have to re-browse back to the SDK Location and then it will re-link in all the jars etc,

    then clean, then build and hey presto! the error goes away.

    ReplyDelete
  2. I have this problem too, but I tried bot suggestions above with no luck...

    ReplyDelete
  3. I tried the same also.
    My solution was
    project -> clean

    Then rebuild and it works again.

    ReplyDelete
  4. Still unable to solve this issue. None of above suggestions work for me

    ReplyDelete
  5. I had a very hard time setting up the ADT plugi.

    Uninstall the Java sdk, Android , Eclipse and follow the steps below. This will work:

    The sys I am using is Windows 7-- 64 Bit OS


    Step 1:
    First download the Java JDK : jdk-6u26-windows-x64.exe -- Windows x64

    Save this file under Program files in C folder ( Note : while installing you must point the directory to Program Files even if the default folder points to Program Files(x 86) in C drive)

    Step 2:
    Download the latest android SDK (installer_r12-windows.exe) and extract the exe file to a folder in C drive. Create One (eg. C:\User)

    Install the packages( will take a hour to install all the packages)

    Step 3:

    Download Eclipse for Java EE developers : 32 bit one even though your computer is a 64 bit .Ectract the eclipse to Program Files (C:\Program Files)

    Step 4 :
    Copy the jre folder from the Java jdk folder that u extracted to the eclipse folder.

    Step 5:

    Run eclipse , install the ADT PLUGIN and to create the AVD point the Window>Preference>Android> Browse to C:\User\Android\android-sdk


    These steps will definitely work

    Thanks,

    Preetam

    ReplyDelete
  6. It do not work definitly -.-

    ReplyDelete
  7. In the end, I did about the same thing. Full reinstallation. Very annoying. I hope I don't have to deal with it again.

    ReplyDelete
  8. I am using Eclipse Juno. The problem fixed after download ADT manually from android website, extract and copy the dx.jar to /(androidsdk)/platform-tools/lib

    ReplyDelete
  9. The easiest and the only 100% working solution: run eclipse as administrator.

    ReplyDelete