构建 Adob​​e Native Extension 时第三方类文件的 NoClassdefFoundError [英] NoClassdefFoundError on thirdparty class files when building Adobe Native Extension

查看:23
本文介绍了构建 Adob​​e Native Extension 时第三方类文件的 NoClassdefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建具有第三方 JAR 依赖项的 Adob​​e Native 扩展 (ANE).我确保将第三方类文件提取并打包在 ANE JAR 中(如 this 答案中所述)

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)

但是,当我为我的应用程序构建最终的 android 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.

推荐答案

不确定这是否是最理想的做法,但我通过替换 $FLEX_AIR_SDK_HOME/lib/android/bin/dx 中的 dx.jar 解决了这个问题.jar 和 Android 构建工具版本 20 中的那个.这个 dx 工具没有剥离 Java 主要版本 51 的类.

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.

这篇关于构建 Adob​​e Native Extension 时第三方类文件的 NoClassdefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆