I'm working on a project where I have two build variants, a chat app for LDS singles and a chat app for Christian singles. They're the same app, just skinned with different colors and a different name. I want to make sure that the LDS apk doesn't include assets from the christian apk and vice versa. My question is, is android studio smart enough to do this automatically or do I need to do something special to make it happen?
Asked
Active
Viewed 73 times
1
-
1Make sure your release builds are marked with `minifyEnabled true` as shown at [this link](https://developer.android.com/studio/build/shrink-code). R8's ability to detect what you're using or not may depend on how you're selectively loading the resources. If it is based on constants in your BuildConfig, that should probably be fine. But if the if-statements are indirect about it, you could possibly end up with extra resources. Another way to handle this is to define separate resource directories for each of your [flavors](https://developer.android.com/studio/build/build-variants). – Tenfour04 Apr 08 '21 at 18:12