简体   繁体   English

将Android项目导出到jar(包括其他jar)

[英]Exporting android project to jar (that includes other jars)

I've written a Android Game Engine library and would like to export it to a jar file. 我已经编写了一个Android Game Engine库,并希望将其导出到jar文件。 I've tried to do this with the following: 我尝试使用以下方法做到这一点:

export > Jar File > Finish 导出> Jar文件>完成

As soon as I add the jar to the build path of another Android project, I get a little box in my code saying: 一旦将jar添加到另一个Android项目的构建路径中,我的代码中就会出现一个小方框:

The type foo cannot be resolved. 无法解析类型foo。 It is indirectly referenced from required .class files 从所需的.class文件间接引用它

I believe this is because my Game Engine library includes other libraries in forms of jars. 我相信这是因为我的Game Engine库包含jar形式的其他库。

How can I add those jar files to my Game Engine jar file? 如何将这些jar文件添加到我的Game Engine jar文件中?

You can decompile the other jar file using JDui , take what you need, and add it to your library. 您可以使用JDui反编译其他jar文件,获取所需内容,并将其添加到库中。 It all depends on how big is what you need.. 这完全取决于您需要多少。

Also, check whether you are using proguard in the export. 另外,检查导出中是否使用了proguard You would have to be careful on how to configure it. 您将必须谨慎配置它。

I assuming you are using Eclipse. 我假设您正在使用Eclipse。 You also need to use Properties->Java Build Path->Libraries->Add Jar button to add your jar file to the target project 您还需要使用Properties-> Java Build Path-> Libraries-> Add Jar按钮将您的jar文件添加到目标项目中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM