NoClassdefFoundError on thirdparty class files whe

2019-07-03 22:33发布

问题:

I am building an Adobe Native extension (ANE) which has third party JAR dependencies. I am making sure that the third party class files are extracted and packaged inside the ANE JAR (as explained in this answer)

But when I build the final android APK for my application, these classes are missing in the classes.dex. It seems that ADT is stripping them out somehow. It is worth mentioning that the third party JAR that I am using is built with Java 1.7 and I am using Java 1.6.

回答1:

Not sure if this is the most ideal thing to do but I solved this by replacing the dx.jar in $FLEX_AIR_SDK_HOME/lib/android/bin/dx.jar with the one in Android build tools version 20. This dx tool was not stripping out classes with java major version 51.