java.lang.NoClassDefFoundError:

Started by
4 comments, last by TheChubu 8 years, 5 months ago
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

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

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.

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

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

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.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

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?


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.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

This topic is closed to new replies.

Advertisement