NoClassDefFoundError的建设的Adobe本机扩展时,第三方的类文件第三方、本机、文件、NoClassDefFoundError

2023-09-09 21:31:00 作者:流过泪的眼睛更明亮

我建立一个Adobe本机扩展(ANE),其中有第三方JAR依赖。我确保第三方的类文件提取和ANE JAR内包装(如这答案)

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)

但是,当我生成最终的Andr​​oid APK我的应用程序,这些类中缺少classes.dex。看来,ADT是其剥离出来,不知何故。值得一提的是,我使用了第三方JAR是建立在Java 1.7和我使用的Java 1.6。

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.

推荐答案

不知道这是最为理想的事情,但我通过更换dx.jar在$ FLEX_AIR_SDK_HOME / lib中/安卓/斌/ DX解决了这个。罐一个在Android的构建工具20版本本DX工具并没有剥离出来的类51 Java的主要版本。

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.