Skip to content Skip to sidebar Skip to footer

R.java Will Not Be Generated (android-maven-plugin)

I tried different goals. mvn package results in package R does not exist, mvn android:generate-sources results in BUILD SUCCESS but no R.java will be created. I would like to pack

Solution 1:

android-maven-plugin has no capability to generate a fully functional jar (contains all compiled class file, resources, manifest and etc) from Android library project.

The solution given by android-maven-plugin is apklib, which is simply a zip of the library project (has same directory structure contains raw java file, resource, manifest and etc). I have explained a bit more about how apklib works in this answer, for some sample projects, check out maven-android-plugin-samples/libraryprojects.

The furthest android-maven-plugin can go is a jar that contains only compiled class file, no resource, this is covered by the default <packaging>apklib<packaging> build life cycle and generated along with the .apklib file.

Post a Comment for "R.java Will Not Be Generated (android-maven-plugin)"