I'm using the Maven Android Plugin to build my application.
Actually, I'm building 3 "branded" versions of the same app (the app icon, colors, etc... change, but not the features). I'm aware that I need to use a different package name for each application, for them to be considered as different.
So far I have managed to have "dynamic" values, using Maven filters in strings.xml :
<string name="app_name">${app_name}</string>
<string name="widget_name">${widget_name}</string>
<string name="app_icon">${app_icon}</string>
The problem is that this does not work for the package name ! If I do :
<manifest package="${foo.bar}">
ADT (well, the XML validator actually) complains saying attribute package has invalid character '$'
I can't find any workaround for this... Is there a way to tell ADT to launch the Maven resources filtering or something like that ?
The package name of an Android app uniquely identifies your app on the device, in Google Play Store, and in supported third-party Android stores.
One method to look up an app's package name is to find the app in the Google Play app store using a web browser. The package name will be listed at the end of the URL after the '? id='.
After further research, it appears to be fairly easy !
You just need to add <renameManifestPackage>
in the configuration of the Maven Android Plugin. Seems to work starting at version > 2.9.0 :
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>maven-android-plugin</artifactId>
<version>2.9.0-beta-5</version>
<configuration>
...
<renameManifestPackage>${manifest_package}</renameManifestPackage>
</configuration>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With