Java Question java.lang.NoClassDefFoundError

walterf25

Expert
Licensed User
Longtime User
Exactly that's what is so confusing because it shows up but yet it gives me that error posted above.

Do you have any clues as to why this might be?
Any update on this issue Erel?
Thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
What is the error?

You wrote:
This was when i tried to compile the library with the SLC tool, but never mind that, i got it to compile just fine, but i still get the same error which is

java.lang.NoClassDefFoundError: com.genesis.hapi.hapipay
at com.genesis.mobilerep.main._activity_create(main.java:318)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at com.genesis.mobilerep.main.afterFirstLayout(main.java:98)
at com.genesis.mobilerep.main.access$100(main.java:16)
at com.genesis.mobilerep.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)

I'm beginning to think that maybe the library i'm trying to wrap is bad or it may contain errors, i tried compiling the library with eclipse and SLC but i get the same above error with either compilation.

I don't understand why it says that the class is not found, when in fact i can see the library in the libs tab and i can also declare a variable as B4AHapi.

Any ideas?
 

walterf25

Expert
Licensed User
Longtime User
Note that you should not extend AbsObjectWrapper if the class includes an instance field.

My guess is that the actual problem is in the hapi library and the error message is misleading. As a test try to create a new class which doesn't reference the Hapi library and see whether you get the same error.
Hi Erel, yes i have already tried creating a new class referencing a different jar file, and it works, so yeah my guess also is that the problem is with the hapi library.

Thanks,
Walter
 
Top