2

I am trying to use PApplet libraries in my Android code. I have attached processing.jar ( which I have got from here ) in the libs folder of the project and added it to build path. But when I start the application on the device , it quickly shutdowns with class not found exception.

Following is the code snippet giving error :

public void generate(){

      bice = Bice.shadowdrawVersion();
      index = new Index(20,3,5,bice.getNumBits());
      index.generateHashes();
      imageLoader = new PApplet();


      index.reverseIndex();

      input = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + 
                "/Download/shadow");
      output = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + 
                "/Download/hashes");

      walk(input);

      String sourceName = input.toString();
      new IndexStorage(output).write(sourceName, index);


  }

And the following is the stack trace which I got from logcat

 01-14 16:14:58.012: E/AndroidRuntime(22538): FATAL EXCEPTION: main
01-14 16:14:58.012: E/AndroidRuntime(22538): java.lang.NoClassDefFoundError: processing.core.PApplet
01-14 16:14:58.012: E/AndroidRuntime(22538):    at bice.Bice.<init>(Bice.java:20)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at bice.Bice.shadowdrawVersion(Bice.java:49)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at com.example.shadowdarw.Generate.generate(Generate.java:45)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at com.example.shadowdarw.MainActivity.onCreate(MainActivity.java:35)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.app.Activity.performCreate(Activity.java:5104)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.app.ActivityThread.access$600(ActivityThread.java:144)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.os.Looper.loop(Looper.java:152)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at android.app.ActivityThread.main(ActivityThread.java:5132)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at java.lang.reflect.Method.invokeNative(Native Method)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at java.lang.reflect.Method.invoke(Method.java:511)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-14 16:14:58.012: E/AndroidRuntime(22538):    at dalvik.system.NativeStart.main(Native Method)

The Bice class which is giving error can be found here. I am using these files as library projects.

I have checked everything in Order and Export , followed this and few other stack overflow post. Still no luck.

Community
  • 1
  • 1
Aman
  • 106
  • 1
  • 3

0 Answers0