I am using ant to generate two different builds, dev and production, of an android project. To allow us to install both simultaneously on our telephones, I am trying to use two different names: com.xyz.android and com.xyzdev.android
Unfortunately, Eclipse uses this name as a classpath to generate R.java, so all of the imports of com.xyz.android.R break in the dev version, because they should in fact be looking for com.xyzdev.android.R
Is there any way to tell Eclipse to use a specific classpath for R.java?
I try with following steps:
created AndroidManifest_dev.xml by coping AndroidManifest.xml and modifying package=”…” , activity etc with absolute class name.
wrote a ant xml file build.xml:
Added a builder in between “Java Builder” and “Android Package Builder”
Eclipse->project->Properties->Builder->New…->Ant Builder->Buildfile , Browse Workspace…->your project->build.xml->Apply->OK
Select New_Builder(1) click Up
Then run the application. It worked.
Hope this may help you.