Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
[ID: 558956]
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
DESCRIBE THE ISSUE IN DETAIL:
I'm trying to manage my build variants to minimize compilation for modules that don't need to use the specific Variant and to also have minimal variants for the set module.
Suppose I have
Build Flavors
in myNetwork Module
for differentBASE_URL
then it is implemented by aRepository Module
which only needs the default Build Variants. The Repository Module is then implemented by theApp Module
with the sameBuildFlavors
fromNetwork Module
for other purposes (e.g. package name, firebase google-services).The problem arises here. The Repository Module cannot resolve the Network Module due to the BuildFlavors so I implemented
missingDimensionStrategy
with the defined flavors in theNetwork Module
so the problem is resolved.The next problem is when selecting
Build Variants
. Network Module Build Variant will not match the App Module Build Variant unless it is the first requested value inmissingDimensionStrategy
. If you manually change the Network Module to match the App Module Variant, the IDE will warn aboutvariant selection conflicts
wherein the Repository Module expects a different BuildVariant. If you Sync Gradle, you can see that the BuildVariants will be defaulted to the ones Gradle expects.I have attached a sample project for you to check out this behavior. I didn't proceed with this since I'm worried that it might compile the wrong variant especially since I'm using Gradle Caching.
Studio Build: Build #AI-242.23339.11.2421.12550806
Version of Gradle Plugin: 8.7.2
Version of Gradle: 8.7.2
OS: Windows 11 Pro 23H2 22631.4460