Wrapper class instantiation error.

A Antonio Coentrao 3 years 7 months ago
2 1 0

Following advice from Developer Event "Best practices EMDK for Android" I've encapsulated the barcode reading functionality in a wrapper class using Barcode API.
Project compiles and runs OK, however it brakes when trying to create an instance of the wrapper class with the following error:
java.lang.NoClassDefFoundError: pt/acoentrao/geslog/core/barcode/ZebraBarcode Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation.
 
After some searching I think it has to do with the fact that the com.symbol.emdk jar being added twice as I need to include it in my wrapper class and the device also has the library by default and there may be a version mismatch. Due to this the Dalvik VM doesn't know exactly what to instanciate.
 
Does this make sense? Any workaround for it?
 
In my project I'm using:
Android Studio 2.1.3
com.symbol.emdk version 5.0
My device is Motorola MC32
 
Thanks in advance for any help.

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

Hello Antonio, The EMDK jar should only be used during development and should not be included in the resulting APK. Please see the following guide section to see how to set this up in the gradle file for your app module.  The EMDK libraries should already exist on your zebra device, and can be upgraded to the latest by following this guide.

CONTACT
Can’t find what you’re looking for?