Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I inherited android projects originally built in Eclipse, later imported into Android Studio. We have a rebranded version of the project done as a code branch, where the only difference is in some of the resources (layout, drawables, strings) used in the home activity UI. This seems ideal for using gradle flavors.

I set up flavors and generated the APKs. Individually, they install and run as expected, with the branded version appearing exactly the way it should.

If both flavors are installed on the same device, Android gets confused. The home screen loads as expected. When a button is clicked that opens a different activity, Android prompts "Open With" and makes the user select which branded version to use.

I've combed through the gradle docs and official tutorials on flavors, everything appears correctly set up. I've searched extensively for similar references to this problem and can't find any.

from the build.gradle file (digitiltreader is the default):
C#
productFlavors {
     InPortPro {
         applicationId 'com.durham.inportpro'
     }
     Profil {
         applicationId 'com.durham.profilreader'
     }
     DigitiltReader {
         applicationId 'com.durham.digitiltreader'
     }
 }


Any ideas? I really don't want to have to maintain multiple projects if I can avoid it, since the projects are virtually identical other than the home screen.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900