Solution 1 :
Wow, I need to manually change variant for dynamic-feature
module, then it’s worked.
But any time I switch between variants, I will have to sync two times (one for first switching on app module, other for switching variant for dynamic-feature
because I only have one module dynamic-feature
)
Solution 2 :
Edit: Its not working anymore after adding build flavors. Have no idea what to do.
I had this issue, but after updating to Android Studio 4.0, Gradle 6.5 and Android Gradle Plugin 4.0.0, now I don’t have to manually switch my dynamic-feature modules anymore, they follow the main module.
Problem :
After I upgrade Android Studio to the latest release 3.6 I faced with the problem when I switch between variants during develop app (has dynamic feature).
My Settings flavors
for all modules (app/library/dynamic-feature):
flavorDimensions "default"
productFlavors {
dev {
isDefault.set(true)
dimension "default"
}
live {
dimension "default"
}
qa {
dimension "default"
}
}
Default variant (both AS3.6 and previous)
When I switched to qa
flavor on AS 3.5.x
When I do that on AS 3.6:
Then AS show message:
Module 'xxx' has variant 'qaDebug' selected, but the module 'dynamic-feature' depends on variant 'devDebug'
My configuration in module dynamic-feature
is depended on build variant. Now, it’s always fallback to dev
.
Is there anyway to solve this problem?
Any suggestions are appreciated, thank you.
UPDATE
This problem also happens on AS4.0
Comments
Comment posted by Benjamin Ledet
I confirm, same problem here, same solution.
Comment posted by Viktor Petrovski
No solution for this, huh? I’m working on a project with 10+ dynamic modules and it is really annoying!
Comment posted by Strauss
Same problem here. I need to manually change variant. Wait for it to sync and then do it again for my other modules. This is too tedious.
Comment posted by mochadwi
using AGP 4.0 & Gradle Wrapper 6.1.1 I still unable to use this features. Does Gradle Wrapper 6.5 necessary to activate this feature? manually switching variant with multiple DFM sometimes leading to human error issue
Comment posted by mochadwi
update: using gradle wrapper 6.5.1 also still doesn’t works
Comment posted by issuetracker.google.com/issues/159377709
the issue reported here: