This is my project setup:
I have 3 modules in an Android Studio project (app, feature & theme):

Important: Only :app & :theme modules have flavors. :feature module has no flavors.
flavorDimensions("product") productFlavors { paid { } demo { } free { } }This makes Build Variants look this way:
This is the dependency graph:
So:
The :app module can see all the resources in :theme module because all Build Variants match
Since the :feature module has no flavors, I have declared the :theme dependency this way:
implementation project(configuration: 'default', path: ':theme')this makes the project to build successfully ✅ ✅ ✅
However, the :feature module can't see resources defined in the :theme module.
If I remove
configuration: 'default'from the dependency declaration, I get this error:ERROR: Unable to resolve dependency for ':feature@debug/compileClasspath': Could not resolve project :theme.This is a layout file in the :feature module:
The
product_nameString is declared in the :theme module in different directories matching the flavor names
The question is:
How do I make the :feature module to recognize the resources declared in the :theme module without having to declare flavors in the :feature module?


