Android Question java.lang.NoClassDefFoundError on library

mauro vicamini

Active Member
Licensed User
Longtime User
Hi Everyone!
I've a problem: I've build a library with Eclipse an succesfully added to my b4a project. It is seen perfectly in the project and the intellisense in the ide show correctly all the methods. When I try to execute the project in the emulator the compiler compile the application correctly but once is executed the emulator throwns this exception:

java.lang.NoClassDefFoundError: it.gekosoftware.ACRNFC.readerNFCWrapper

where it.gekosoftware.ACRNFC.readerNFCWrapper is the library that I've created an that is referenced in the project.

I've also decompile the dex file in the apk and I've seen that the calsses of my package are not prensent, but are present the classes of a package referenced by it that I've manually added in the jar file of my library once created from Eclipse.
It seem that the IDE doesn't construct correctly the dex file in the apk. I've missed somthing?

Thanks for any help.

Mauro
 

warwound

Expert
Licensed User
Longtime User
Basic4Android libraries should be compiled using java compiance level 1.6.
I've found using compliance level 1.7 causes this 'class not found' error.

Right click your project in Eclipse and choose Properties.
Select Java Compiler in left hand pane.
What java compliance level is selected?

If you have java 1.7 installed and Eclipse has chosen compliance level 1.7 for you then you can change to compliance level 1.6 with no need to install java 1.6.
I have java 1.7 installed here and can choose compliance level 1.6 or 1.7 with no need to have java 1.6 installed.

Martin.
 
Upvote 0

mauro vicamini

Active Member
Licensed User
Longtime User
Basic4Android libraries should be compiled using java compiance level 1.6.
I've found using compliance level 1.7 causes this 'class not found' error.

Right click your project in Eclipse and choose Properties.
Select Java Compiler in left hand pane.
What java compliance level is selected?

If you have java 1.7 installed and Eclipse has chosen compliance level 1.7 for you then you can change to compliance level 1.6 with no need to install java 1.6.
I have java 1.7 installed here and can choose compliance level 1.6 or 1.7 with no need to have java 1.6 installed.

Martin.
Thanks a lot!!!
It solved my problem!!
GREAT!!!
 
Upvote 0
Top