0

Is there a way in Android Studio build process to include certain drawables or any other files for that matter in the final build/apk based on flavors. What I have is an application that extends to a number of sub applications which have increased in part because of the free and pro versions. Different "flavors" contain different drawables and data files. It is mainly drawables that I would like to isolate for different flavors because there are a lot and the app would be way too big to contain all of them in one project built with flavors.

This is how far I got with research: https://developer.android.com/studio/build/build-variants.html

All versions of my app share the same code and I would just like to isolate the data and images. I think flavors would be a perfect solution if I can get around the drawables build.

Example current project structure:

test.app1.pro
--src
--res
---drawables
---raw
...ect

test.app1.free
--src
--res
---drawables
---raw
...ect

test.app2.pro
--src
--res
---drawables
---raw
...ect

test.app2.free
--src
--res
---drawables
---raw
...ect

test.app3.pro
--src
--res
---drawables
---raw
...ect

...etc
Saleh
  • 150
  • 10

1 Answers1

1

The answer is Android Studio source sets thanks to this: Different drawable based on build variant in Gradle

and this: https://developer.android.com/studio/build/index.html

Creating build type and flavor specific source sets in android studio should resolve the problem I am trying to resolve.

Saleh
  • 150
  • 10