Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem switch build variant with Dynamic Feature on Android Studio 3.6

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)

enter image description here

When I switched to qa flavor on AS 3.5.x

enter image description here

When I do that on AS 3.6:

enter image description here

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

like image 374
Robust Avatar asked Feb 27 '20 08:02

Robust


1 Answers

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)

like image 122
Robust Avatar answered Oct 01 '22 03:10

Robust