Setting custom package for R.java using the maven-android-plugin

252 views
Skip to first unread message

asokan

unread,
Nov 29, 2010, 1:36:46 PM11/29/10
to Maven Android Developers
Hello

The aapt tool gives two options (--custom-package and --rename-
manifest-package) to customize the package name for R.java. Is
there a way to set these options using the maven-android-plugin?

Thanks
Sandeep

Hugo Josefson (Jayway)

unread,
Nov 29, 2010, 1:55:08 PM11/29/10
to Maven Android Developers
Hi Sandeep!

No, the plugin does not currently support those parameters.

Could you please elaborate on what they are for and how you would want
to use them?

Thanks,
Hugo

asokan

unread,
Nov 29, 2010, 2:30:13 PM11/29/10
to Maven Android Developers
Hi Hugo
We have multiple android apps that need to use a set of shared classes
that refere to resources in R. As each app has a different package
name and R gets generated by the package name, the common classes end
up in conflict. Our thought is that if we can override the package
name for R, to a common package name, independent of the package name
in the AndoidManifest, and both apps refer to the same R, there will
not be a conflict.

For example
Package for App A - com.sample.app.a;
Package for App B - com.sample.app.b;
Package for common R used by both Apps - com.sample.shared.r

So when running aapt, if I could say
<customPackage>com.sample.shared.r<customPackage> it would help to
keep the R references consistent between the apps and the shared
classes.

Please let me know if you need more information.
Thank you for your quick response.
Sandeep


On Nov 29, 11:55 am, "Hugo Josefson (Jayway)" <h...@josefson.org>
wrote:

Jim Showalter

unread,
Nov 29, 2010, 11:51:23 PM11/29/10
to maven-androi...@googlegroups.com
I ran into this very problem over a year ago, and at the time gave up on finding a solution. If it's possible to have R be in common by more than one app, that would be really useful.

--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To post to this group, send email to maven-androi...@googlegroups.com.
To unsubscribe from this group, send email to maven-android-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maven-android-developers?hl=en.


Reply all
Reply to author
Forward
0 new messages