Binding warning J2X9001: Couldn't load class {class} java.lang.ClassFormatError

I'm trying to bind a newer version of a JAVA API that I had already integrated into an Xamarin.Android app. Some changes have been made to the .jar and I am getting the following warnings while compiling the binding project. Even tough the project compiles, two of the classes are not present in the api.xml file for the newer version of the API binding project.

This is the warning I'm getting:

1>JARTOXML : warning J2X9001: Couldn't load class {class B} : java.lang.ClassFormatError: LVTT entry for 'decodeData' in class file {class B} does not match any LVT entry
1> java.lang.ClassFormatError: LVTT entry for 'decodeData' in class file {class B} does not match any LVT entry (TaskId:52)
1> at java.lang.ClassLoader.defineClass1(Native Method) (TaskId:52)
1> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) (TaskId:52)
1> at java.lang.ClassLoader.defineClass(ClassLoader.java:615) (TaskId:52)
1> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) (TaskId:52)
1> at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) (TaskId:52)
1> at java.net.URLClassLoader.access$000(URLClassLoader.java:58) (TaskId:52)
1> at java.net.URLClassLoader$1.run(URLClassLoader.java:197) (TaskId:52)
1> at java.security.AccessController.doPrivileged(Native Method) (TaskId:52)
1> at java.net.URLClassLoader.findClass(URLClassLoader.java:190) (TaskId:52)
1> at java.lang.ClassLoader.loadClass(ClassLoader.java:306) (TaskId:52)
1> at java.lang.ClassLoader.loadClass(ClassLoader.java:247) (TaskId:52)
1> at java.lang.Class.getDeclaredFields0(Native Method) (TaskId:52)
1> at java.lang.Class.privateGetDeclaredFields(Class.java:2300) (TaskId:52)
1> at java.lang.Class.getDeclaredFields(Class.java:1745) (TaskId:52)
1> at jar2xml.JavaClass.getDeclaredFields(JavaClass.java:727) (TaskId:52)
1> at jar2xml.JavaClass.doAppendToDocument(JavaClass.java:715) (TaskId:52)
1> at jar2xml.JavaClass.appendToDocument(JavaClass.java:559) (TaskId:52)
1> at jar2xml.JavaPackage.appendToDocument(JavaPackage.java:72) (TaskId:52)
1> at jar2xml.Start.main(Start.java:127) (TaskId:52)
1>JARTOXML : warning J2XA006: missing class error was raised while reflecting {class A} : LVTT entry for 'decodeData' in class file {class B} does not match any LVT entry
1>Ejecución de la tarea "JarToXml" terminada. (TaskId:52) ===>> This would be something like ... "JarToXml" task execution terminated.

The only visible changes I noticed between the original jar and the newer version of it are :

1) Class A and Class B are now defined in the same file, in the original version there was a file for Class A and another for Class B

2) Both classes have a new imports:

import android.annotation.SuppressLint;

3) Both classes are defined as follows, with a @SuppressLint annotation :

<br /> <strong>@SuppressLint({"SimpleDateFormat", "DefaultLocale"})</strong><br /> public class {class A}</p> <p><strong>@SuppressLint({"DefaultLocale"})</strong><br /> class {class B}<br />

3) The method which defines the decodeData parameter is defined as follows, also with the @SuppressLint annotation:

<br /> <strong>@SuppressLint({"DefaultLocale"})</strong><br /> public void onReturnCheckCardResult(EmvSwipeController.CheckCardResult checkCardResult, Hashtable&lt;String, String> decodeData)<br />

4) The decodeData parameter in one of the methods was originally defined as Hashtable decodeData and in the newer version it's defined as Hashtable&lt;String, String> decodeData

Any ideas or suggestions on how to resolve this warning and therefore allowing the JarToXml tool to create the missing classes ?

Sign In or Register to comment.