Reputation: 13747
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.
Upvotes: 1
Views: 159
Reputation: 15
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
Upvotes: 1
Reputation: 1562
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
Upvotes: 1
Reputation: 515
it is easy to find the error if you send the src code of your Pixel class.
Upvotes: 0