Issue
In my android app I have a file that I want to override for a specific flavor. My structure: alt="Structure">
However when I build the funki flavour I still see that the Computer class from main is used. In my build.gradle I have:
productFlavors {
somename{
resValue "string", "app_name", "some name"
}
funki {
resValue "string", "app_name", "Funki App"
applicationIdSuffix ".funki"
}
}
Every build I see that the Computer file from main is used. All the other overrides e,g, res files are overriden based on the flavor i build. How can I override a class for a specific flavor?
Solution
I ended up checking the productflavor inside the code like:
if(BuildConfig.FLAVOR.equals("funki")){
Based on the if/else I execute my desired code.
Answered By - Sven van den Boogaart
Answer Checked By - Marie Seifert (JavaFixing Admin)