如何将安卓库项目转换为包含所有类和资源.jar文件



我需要将 android 项目转换为包含所有类和资源.jar文件。我尝试通过转换为安卓库项目,然后转换为 jar 文件。它始终显示空指针异常。

如果你的库是纯粹的Java代码,没有资源,你可以从.class文件中创建一个JAR,就像使用常规Java一样:

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

有关java的分步详细信息,请参阅此处。对于安卓,请参阅此和。

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.

编辑:
有关使用库的可绘制对象的信息,请参阅此处。

最新更新