I have set up Gradle to add package name suffix to my debug app so I could have release version that I\'m using and debug version on one phone. I was referencing this: http:
I don't know if anybody mention it. Actually after android gradle plugin 0.10+, the manifest merger will provide the official support for this function: http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger
In AndroidManifest.xml, you can use ${packageName} like this:
And in your build.gradle you can have:
productFlavors {
free {
packageName "org.pkg1"
}
pro {
packageName "org.pkg2"
}
}
See full example here: https://code.google.com/p/anymemo/source/browse/AndroidManifest.xml#152
and here: https://code.google.com/p/anymemo/source/browse/build.gradle#41