lopez.mikhael
lopez.mikhael

Reputation: 10061

Android app crashes after SDK-tools update version (NoClassDefFound, tool version 22)

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 :

But I don't understand why! Would anybody have an explanation ?

Upvotes: 36

Views: 13902

Answers (9)

Srikanth Reddy Ramidi
Srikanth Reddy Ramidi

Reputation: 13

Solutions:

  1. Check Exports Order
  2. Enable Multi Dex
  3. 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.
  4. Check support Libraries v4,v7 etc

Upvotes: 0

user3486184
user3486184

Reputation: 2375

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:

  1. Build -> Edit Libraries and Dependencies
  2. Click the + button
  3. Select the support-v4 library
  4. Click OK.

That's it.

Upvotes: 0

Hemant G
Hemant G

Reputation: 653

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.

Upvotes: 0

Jordi Moliner
Jordi Moliner

Reputation: 1

I solve this with Android Tools->Add support Library

Upvotes: 0

magicode118
magicode118

Reputation: 1474

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)

enter image description here

Then I cleaned the Project (Project > Clean... > OK) and everything worked fine.

Upvotes: 2

Sachin Jain
Sachin Jain

Reputation: 139

I had similar issue, following two steps fixed it:-

  1. Java Build Path -> Order and Export tab.

  2. Then "Project -> Clean".

Upvotes: 0

Ray
Ray

Reputation: 16235

Also need to make sure the Android Dependencies is checked in the Order & Export tab. Both are needed when using other library projects.

Upvotes: 0

StylezSoft
StylezSoft

Reputation: 1

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.

Upvotes: 0

acedanger
acedanger

Reputation: 1206

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

Upvotes: 36

Related Questions