Jump to content
  • Advertisement
Sign in to follow this  
grumpyOldDude

java.lang.NoClassDefFoundError:

This topic is 1049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Running Android on my device i am encountering the crash below after including this code
 
import android.support.v7.graphics.Palette;
....


public Palette palette;

public void runPalette(){
    ....
    myBitmap = Bitmap.createScaledBitmap(bitmap, width, height, false); 

    palette = Palette.from(myBitmap).generate();
    .....
}
11-08 17:42:27.152: E/AndroidRuntime(4449): FATAL EXCEPTION: main
11-08 17:42:27.152: E/AndroidRuntime(4449): java.lang.NoClassDefFoundError: android.support.v4.graphics.ColorUtils

I have downloaded Android Support Library and added Android-support-v4 to the built path (Eclipse IDE)

 

Any clues how to resolve this? thanks

 
 

Share this post


Link to post
Share on other sites
Advertisement

The java.lang.NoClassDefFoundError means the class loader couldn't find the .class file or the library containing the class.

 

 

If you are running from an apk, ensure the jar files are exported into the apk file.  Since you say you are using Eclipse, find the "Order and Export" page of the build settings and make sure all the needed libraries are present and have checkmarks to package them.

Share this post


Link to post
Share on other sites

thanks for reply

 

this is what my "order and export" settings looks like. Just to make sure I don't check the wrong things -as understandable  documentations on these things are scarce-  

 Do I also check every box below "Android dependencies"?  thanks

 

[attachment=29579:build libraries3.png]    [attachment=29578:build libraries2.png]

 

The problem is identifying what jar file is missing, where to find it and include it. The crash log suggests "ColorUtils.jar" is missing but I can't find this jar file anywhere, even after downloading from Android Support Library many times. 

 

Like I said documentation on this specific is rare and at best scattered, and thats made me resort to trial and error. And that means I might end up screwing up the environmentsmile.png

Share this post


Link to post
Share on other sites

Kinda offtopic but I'd just try with Android Studio instead.

 

Make no mistake, I use Eclipse for day to day Java, but Android Studio is a pretty hassle free experience for Android dev.

Share this post


Link to post
Share on other sites

Kinda offtopic but I'd just try with Android Studio instead.

 

Make no mistake, I use Eclipse for day to day Java, but Android Studio is a pretty hassle free experience for Android dev.

What about NDK these days? Is it well supported?

Share this post


Link to post
Share on other sites


What about NDK these days? Is it well supported?
No idea, strictly talking Java here. Never heard someone saying good things about NDK though, not lately nor ever.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!