问题
I created a ane native extension for a flex application and I have a problem. My problem is that i get a NoClassDefFoundError from native java code. The class that is not found is in a third-party jar. I added the third-party jar as a lib file in eclipse, is also set on project build pats and is also set as exported resource. I think the problem is when i pack the final .jar file for the extension. I unpacked the .jar file and the third-party jar is there.
回答1:
You have to be careful when packaging a third party library with your Java ANE. You often need to unpack the third party jar file and include the class files along with your own.
jar xf 3rd_party_lib.jar
Then repackage your ANE library jar
jar uf your_native_ane_libary.jar [directory of all your class files]
You have to do this just before using adt to package your ANE.
来源:https://stackoverflow.com/questions/15041085/noclassdeffounderror-android-flex-ane-extension