Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] Problem switch build variant with Dynamic Feature on Android Studio 3.6

Posted on November 11, 2022 By

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)

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

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.

READ  [FIXED] android - How to know if an App is in the recent app list or not?
Powered by Inline Related Posts

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:

Android Tags:android, android-studio, build-variant, gradle

Post navigation

Previous Post: [FIXED] Is it possible to switch from Start state to End state in android MotionLayout using Java/Kotlin?
Next Post: [FIXED] android – PHP / SQL: cannot save image at server but successful save image link at SQL database

Related Posts

[FIXED] android – Room Migration Not Finding Table Columns Android
[FIXED] android – Create custom preference Android
[FIXED] android – CameraX – crash when unbinding Preview UseCase Android
[FIXED] android – Change the background of an individual cell/item in RecyclerView Android
[FIXED] Android listview display Android
[FIXED] alarmmanager – How to use Alarm Manager on Android 9 and Android 10? Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • What are the main features of Islamic education?
  • Is the Jeep 4xe worth it?
  • How does the ringer work on cast iron?
  • What is the biggest size interior door?
  • Is blue raspberry an original Jolly Rancher flavor?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme