1

I have two classes in a different projects.

I am importing the project that has the class that I need. Now, I have no errors.

The project know's that class and I even made an object from that class, but when I'm trying to run it it crushes with the "NoClassFoundError".

How can i fix that?

import com.dmg.pixelservice.core.*;
import android.app.Activity; 
import android.os.Bundle;
public class show extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Pixel pixel = new Pixel();
    pixel.doIt(this,"fd7ccf36-3f85-11e1-8671-40409e0f44a1",true);
    setContentView(R.layout.main);
}
}

When I debug, I can see that it crashes when I'm trying to do Pixel pixel = new Pixel();

Please help.

Dhasneem
  • 4,037
  • 4
  • 33
  • 47
roiberg
  • 13,629
  • 12
  • 60
  • 91
  • 1
    see this answer http://stackoverflow.com/a/10046725/1289716 – MAC May 08 '12 at 11:27
  • possible duplicate of [Android update 17 seems incompatible with external Jars](http://stackoverflow.com/questions/10046298/android-update-17-seems-incompatible-with-external-jars) – waqaslam May 08 '12 at 11:30
  • do i need to creat a jar file of the imported project? – roiberg May 08 '12 at 11:40

3 Answers3

1

create new libs folder in your application .name must be same.and put your jar files in this folder.and go to java Build Path -> Configure Build Path -> Add jars

ankita gahoi
  • 1,532
  • 2
  • 15
  • 28
1

Looks like the jar file containing the Pixel class is not packaged into the APK.

To make that happen, it seems you need to copy the jar into the libs folder of your Android project.

See this question:
Approach for fixing NoClassDefFoundError?

Android Developer Guide:
http://developer.android.com/guide/developing/projects

Community
  • 1
  • 1
0

it is easy to find the error if you send the src code of your Pixel class.

user1208720
  • 515
  • 2
  • 6