NoClassDefFoundError android flex an extension [英] NoClassDefFoundError android flex ane extension

查看:25
本文介绍了NoClassDefFoundError android flex an extension的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为 flex 应用程序创建了一个本机扩展,但遇到了问题.我的问题是我从本机 Java 代码中得到了 NoClassDefFoundError.未找到的类位于第三方 jar 中.我在 eclipse 中添加了第三方 jar 作为 lib 文件,也在项目构建 pats 上设置,也设置为导出资源.我认为问题是当我打包扩展的最终 .jar 文件时.我解压了 .jar 文件,第三方 jar 就在那里.

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.

推荐答案

使用 Java ANE 打包第三方库时必须小心.您经常需要解压第三方 jar 文件并将类文件与您自己的文件一起包含.

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

然后重新打包你的 ANE 库 jar

Then repackage your ANE library jar

jar uf your_native_ane_libary.jar [directory of all your class files]

您必须在使用 adt 打包 ANE 之前执行此操作.

You have to do this just before using adt to package your ANE.

这篇关于NoClassDefFoundError android flex an extension的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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