decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
new ViewfinderResultPointCallback(activity.getViewfinderView()));
For the above code I am getting below exception:
01-24 01:33:02.078: E/AndroidRuntime(708): java.lang.NoClassDefFoundError: com.main.onlinecart.ViewfinderResultPointCallback
The class ViewfinderResultPointCallback is present in the same package of the calling class. I am not getting the error for other classes that are being used from the same package. What can be a possible problem here? Anything related to classpath? Where can i crosscheck the class path variable?
I am using eclipse (on mac os x) and running the project from Run configuration.
The class ViewfinderResultPointCallback implements another class ResultPointCallback which is not in the same package but it is present in a jar added in the build path of the project. And i see one exception in the log:
01-24 01:33:01.968: I/dalvikvm(708): Failed resolving com/main/onlinecart/ViewfinderResultPointCallback; interface 472 'Lcom/google/zxing/ResultPointCallback;'
01-24 01:33:01.968: W/dalvikvm(708): Link of class 'Lcom/main/onlinecart/ViewfinderResultPointCallback;' failed
but there are many other classes from the same jar which are not throwing any error.
The NoClassDefFoundError was because of my class’ dependency on one of the interfaces from a jar. The error got solved when i added the jar to my project’s libs directory. This is required because i am working on an android project and when .apk file is created, it adds the jars from libs folder for run time use.