Reputation: 14818
Yesterday evening I upgrade to ADT-21
and restarted eclipse. Then eclipse said that you need to update android tool to version 21. I downloaded window_installer21
and install it in the same location where my previous window_installer was installed. So it overwrite the file. Then I restarted eclipse and suddenly all project stop working. Eclipse always open with the error.
SecurityException: Unable to find field for dex.jar
And when i try to launch a project it stops with the below error
Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
SDK Manager is also not opening.
I have tried:
Nothing seems to work.
Upvotes: 6
Views: 8282
Reputation: 7
If the .jar file could not load try this..
locate android-sdks\build-tools\28.0.3\lib
delete the dx.jar file
Select the appropriate sdk tools that your android application works with thorugh sdk manager
Again search for
Here i am using apk 21.0.1
locate android-sdks\build-tools\21.0.1\lib
Cut the dx.jar file and paste it in the android-sdks\build-tools\28.0.3\lib folder
Upvotes: 0
Reputation: 16
This is caused by the existence of an older version of dx.jar
in the VirtualStore (a folder where windows stores user versions of system and program files).
Go to "C:\Users\<your user name>\AppData\Local\VirtualStore\<android-sdk path>"
and delete all the content, or just the "\platform-tools\lib\dx.jar"
file.
i.e: if your user name is "user32"
and your android SDK is placed in "C:\Program Files\Java\android-sdk"
, after the update you'll probably have an obsolete version of dx.jar
in "C:\Users\user32\AppData\Local\VirtualStore\Program Files\Java\android-sdk\platform-tools\lib\"
Upvotes: 0
Reputation: 6975
Help > Check for Updates
Window > Android SDK Manager
Upvotes: 0
Reputation: 199
A popup appears warning you to update to the latest sdk and opens the appropriate tool. Tried this (several times - restarting each time) with no effect.
Instead the answer was ..
In eclispe, find the location of your android sdk (Window->Preferences->Android and the SDK location is at the top of the page).
Close down eclispe.
Find the sdk on the disk - and run the standalone SDK Manager.exe (It appears to fail when first opened - but wait a second or two for the gui to appear). Note - this is the same gui that was previously opened by eclipse!
Take all the updates as recommended. A dialog box appears indicating that the management tool itself has been updated and should be restarted.
Restart the tool - take any more updates recommended and close.
Start eclipse - the problem has gone away!
Upvotes: 6
Reputation: 4043
Since I got this issue I started using Google ADT Bundle from http://developer.android.com/sdk/index.html
Everything is fine now.
Upvotes: 1
Reputation: 174
I was having a similar problem after installing the latest Android/Eclipse direct from the Android developer site. I was also seeing another error related to find_java claiming it couldn't find Java in c:\windows\system32\java.exe. I had previously used MOTODEV studio a year ago (haven't touched it since). I was concerned it might cause a conflict, so I uninstalled it. However it left some bits and pieces in my c:\Users\ folder. I blew away some hidden directories related to android, as well as an androidsdks directory that had been installed there and likewise blew away my workspace folder. Then I launched Eclipse/SDK Manager and all was right with the world :)
Upvotes: 1
Reputation: 3169
I you got the same error message, but SDK manager works for you, run it with administrator privileges and delete both packages in Tools folder. Then install them again.
Upvotes: 0
Reputation: 1
Update your Android tool/sdk with latest and create new workspace .it solved problem for me
Upvotes: 0
Reputation: 707
try to install fresh andoridSDK. the problem is with SDK and not with your eclipse.
Upvotes: 0