5

I've just updated to Android Studio 3.6 stable version. After that, every time I open my project. The Android Studio changes my selected build variant to the first item in the variant list. Then I have to change the selected variant and sync gradle again. :(

Anyone have solution for this?

Harvey
  • 1,353
  • 1
  • 14
  • 27
  • 1
    Sounds like a bug [you may want to report](https://developer.android.com/studio/report-bugs) – Benoit Feb 28 '20 at 10:14
  • same here, having multiple modules in app is a nightmare (and recompilation times are much much longer) – adek111 Mar 02 '20 at 09:21
  • I have the same problem. I can compile through command line the intended variant, but not from the Interface the picker simply refuse to change build variant. – MRodrigues May 15 '20 at 17:39

2 Answers2

1

I think it is problem of upgrading android studio from version <= 3.5

My solution for this is to push your project to any VCS. Then you clone it as a new project and use android studio to open it. You will find the build variant is working again.

Neo Luk
  • 446
  • 4
  • 10
0

To fix this issue, you can mark the flavor that you use regularly as default:

flavor {
        isDefault.set(true)
        ...
}

This way the IDE will pick this flavor when it starts, instead of relying on the alphabetical order.

Hicham
  • 720
  • 6
  • 9