问题
I have just updated my android SDK tools to the newly released version (tools version 22, platform tools version 17)
java.lang.NoClassDefFoundError
The .classpath file was modified. The update in added a line :
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
Before the SDK tools update, all my projects worked well !!
I corrected my problem in this way :
- In the project properties (eclipse) -> java build path -> order and export make sure that all your jars in the libs folder are checked.
- And "Android Tools -> Fix Project Properties"
- And "Project -> Clean"
But I don't understand why! Would anybody have an explanation ?
回答1:
I fixed it by going into Java Build Path > Order and Export tab.
Click everything in the list "Android Private Libraries".
Then "Project -> Clean". That fixed my issue.
Just over 1.5 days on this issue, solved my problem by reading Google+.
回答2:
Had the same issue as StylezSoft. To clarify even further, below is my Java Build Path from Eclipse after that I solved the issue (by ticking the android-support-v4.jar
library)

Then I cleaned the Project (Project > Clean... > OK) and everything worked fine.
回答3:
I had a similar issue after the upgrade. The problem in my case was that the android-support-v4.jar library had become unchecked in the Order and Export- list. Check + rebuild solved it for me.
The error manifested itself by crashing the app when opening a dialog with a Facebook LoginButton widget on it.
回答4:
Also need to make sure the Android Dependencies is checked in the Order & Export tab. Both are needed when using other library projects.
回答5:
I had similar issue, following two steps fixed it:-
Java Build Path -> Order and Export tab.
Then "Project -> Clean".
回答6:
I solve this with Android Tools->Add support Library
回答7:
I had similar issue. But the problem was jar mismatch of "android-support-v4.jar" between Facebook SDK and my application. When I copied the same jar file from Facebook SDK to my application lib folder, the issue was resolved.
回答8:
I ran into this on Android Studio. Since most of the answers here are for Eclipse, here's how to add the supportv4 library on Android Studio:
- Build -> Edit Libraries and Dependencies
- Click the + button
- Select the support-v4 library
- Click OK.
That's it.
回答9:
Solutions:
- Check Exports Order
- Enable Multi Dex
- Check api level of views in layout. I faced same problem with searchView. I have check api level while adding searchview but added implements SearchView.OnQueryTextListener to class file.
- Check support Libraries v4,v7 etc
来源:https://stackoverflow.com/questions/16589821/android-app-crashes-after-sdk-tools-update-version-noclassdeffound-tool-versio