Android Studio 3.6 always select the first build variant

Viewed 688

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?

2 Answers

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.

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.

Related