Reputation: 51
I have imported a .jar into my Eclipse Android project (importing it to the libs folder and adding the jar to the libraries in Java Build Path), but when I attempt to use it, I get a java.lang.VerifyError. The JAR library I am using is starIOport.jar. It is from SDK for using mobile printers on android phones. It is made by Star Micronics company. My printer is SM-T300, but it probably doesnt matter since I dont even get to communicating with the printer. I get the error every time I get to the object, whose class imports classes from the jar. Does anyone know, what to do? I havend found anywhere on the internet anyone ancountering this specific problem with this jar. I dont think there is some incompatible stuff with android in it, since it is made for android devices. Does not work on my friends android phone either. Not even in emulator.
Link to the SDK. It is newer version, but I have the same problem with this version as well.: http://www.starmicronics.com/absolutefm/absolutefm/?f=174
Here is my log
05-05 14:26:46.032: E/AndroidRuntime(3006): Caused by: java.lang.VerifyError: com.StarMicronics.StarIOSDK.PrinterFunctions
05-05 14:26:46.032: E/AndroidRuntime(3006): at com.StarMicronics.StarIOSDK.StarIOSDKActivity.GetStatus(StarIOSDKActivity.java:71)
and this is the line thats causing it. It is not the only one, every line doing something with the class PrinterFunctions, which imports jar classes, causes the error.
PrinterFunctions.CheckStatus(this, portName, portSettings);
Upvotes: 1
Views: 875
Reputation: 702
Library handling was changed since r17's release, assuming you're using this ADT version or higher.
You can do this too to remedy the issue:
This is a great article to reference for JAR issues after upgrading from r16: http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17
Upvotes: 1