I use aapt's --rename-manifest-package to generate env specific packages.
the package names in prod, I use
com.xxx.app
for uat env, I use
com.xxx.app.uat
it works fine until I added phonegap, I'm using codorva 2.2, it gives me below error
12-12 19:02:36.156: E/PluginManager(13188): =====================================================================================
12-12 19:02:36.156: E/PluginManager(13188): ERROR: plugin.xml is missing. Add res/xml/plugins.xml to your project.
12-12 19:02:36.156: E/PluginManager(13188): https://git-wip-us.apache.org/repos/asf? p=incubator-cordova-android.git;a=blob;f=framework/res/xml/plugins.xml
12-12 19:02:36.156: E/PluginManager(13188): =====================================================================================
I finally traced down to below code in PluginManager
int id = this.ctx.getActivity().getResources().getIdentifier("config", "xml", this.ctx.getActivity().getPackageName());
...
XmlResourceParser xml = this.ctx.getActivity().getResources().getXml(id);
the id is 0 which means it failed to reference the config.xml getActivity().getPackgeName() gives replaced package name - "com.xxx.app.uat"
it looks like .getResources().getIdentifer() was not updated to new package... could it be a bug from android?
In my test case, if I use R.xml.config, it referenced config.xml without issues.
the problem is I can't change PluginsManager which is a part of Phonegap codebase...