问题
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.
回答1:
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".
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.
EDIT:
For using drawables of the library see this.
来源:https://stackoverflow.com/questions/27354555/how-to-convert-android-library-project-to-jar-file-with-all-classes-and-resourc