I am retro-fitting a Maven project around a set of Android projects (written using Eclipse). Some of the Android projects are libraries of common code and resources. Since the Android library projects have resources, they have their own R, which I reference from within the common library code. Following the instructions in the Maven: Complete Reference, chapter 14, I have got mostly everything working. The library sources are included and compiled from the projects that开发者_Python百科 reference the library. However, compilation fails, since the generated library R is not included in the library sources. How do I get the Maven compilation to work?
Maven Android Plugin is currently being updated with support for Android Library projects, <packaging>apklib</packaging>
. This takes care of R.java in a correct way, and should be used instead of <packaging>apksources</packaging>
.
Look at the changelog for the latest version to use:
http://code.google.com/p/maven-android-plugin/wiki/Changelog
Here are the release notes for the first beta:
http://groups.google.com/group/maven-android-developers/browse_thread/thread/e7978fbf4e4b85f0?pli=1
This is where the apklib
support in maven-android-plugin is documented:
http://code.google.com/p/maven-android-plugin/wiki/ApkLib
精彩评论