如何转换的Andr​​oid库项目.jar文件中的所有类和资源? [英] How to convert android library project to .jar file with all classes and resources?

查看:152
本文介绍了如何转换的Andr​​oid库项目.jar文件中的所有类和资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要转换的Andr​​oid项目.jar文件中的所有类和resources.can我们有一个选项可以做到这一点?我试图通过转换到Android库项目,然后到jar file.It总是显示空指针异常。

I need to convert android project to .jar file with all classes and resources.can we have a option to do that ? I tried by converting to android library project and then to jar file.It always shows null pointer exception.

推荐答案

如果你的库是纯Java的code,没有资源,你可以创建一个JAR出来的.class文件,就像你会与常规Java的:

If your library is purely Java code, with no resources, you can create a JAR out of the .class files, just as you would with regular Java:

1. Right click the project.
2. Export --> Java --> JAR file.
3. Tick the files to include and name the jar, click "Next".

有关一步一步的细节柜面的java看到
为Android看到这个

For step by step details incase of java see this. For android see this ans.

You cannot export the library project to a self-contained JAR file, as you would do for
a true library. Instead, you must compile the library indirectly, by referencing
the library in the dependent application and building that application.

编辑:

对于使用该库的可绘制看到这个

这篇关于如何转换的Andr​​oid库项目.jar文件中的所有类和资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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