0

I'm trying to make a restricted version of barcode scanner, which can only scan 2d data matrices. I figured the best way to do this would be to get the latest source from ZXing svn repository, build the core.jar, include it in the app lib, and work from there.

However, to see how various components in the app work I tried to run the barcode scanner app using the android source code in the ZXing repository. To do this I followed instructions given on

https://stackoverflow.com/a/4854637/1273954
https://stackoverflow.com/a/4825803/1273954
& also http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/

All these posts inherently talk about the same thing and same approach. However, each time I run the application, my device says "Unfortunately, Barcode SCanner has stopped"

Here is what logcat shows :

12-12 17:18:56.213: E/AndroidRuntime(15408): FATAL EXCEPTION: main
12-12 17:18:56.213: E/AndroidRuntime(15408): java.lang.ExceptionInInitializerError
12-12 17:18:56.213: E/AndroidRuntime(15408):    at java.lang.Class.newInstanceImpl(Native Method)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at java.lang.Class.newInstance(Class.java:1319)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1964)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2083)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.app.ActivityThread.access$600(ActivityThread.java:134)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1233)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.os.Looper.loop(Looper.java:137)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at android.app.ActivityThread.main(ActivityThread.java:4697)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at java.lang.reflect.Method.invokeNative(Native Method)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at java.lang.reflect.Method.invoke(Method.java:511)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
12-12 17:18:56.213: E/AndroidRuntime(15408):    at dalvik.system.NativeStart.main(Native Method)
12-12 17:18:56.213: E/AndroidRuntime(15408): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
12-12 17:18:56.213: E/AndroidRuntime(15408):    at com.google.zxing.client.android.CaptureActivity.<clinit>(CaptureActivity.java:96)
12-12 17:18:56.213: E/AndroidRuntime(15408):    ... 15 more

The Posts also speak about modifications to the file androidManifest.xml. I have no idea what modifications to make there.

Any help or redirection or resource reference in this would be appreciated.

Community
  • 1
  • 1
blunder
  • 99
  • 1
  • 2
  • 11

1 Answers1

0

You're getting a NoClassDefFoundError. This means your jar file is not available at runtime. In order for it to be available at runtime you'll have to check the checkboxes on your jar file in your java build path like so: enter image description here

Ahmad
  • 69,608
  • 17
  • 111
  • 137