How to change Android Studio’s default build flavor? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How to change Android Studio’s default build flavor? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I got a project configured with multiple variants and flavors:

buildTypes {
    debug {
    }
    release {
    }
}
flavorDimensions "default"
productFlavors {
    mock {
    }
    alpha {
    }
    beta {
    }
    prod {
    }
}

Whenever I open the project from another one (so starting Android Studio), it selects the mockDebug variant by default. Often I end up build this one first, then realizing I’m on the wrong variant.

Is there a way to tell Android Studio to defaults to one variant, let’s say betaDebug?

Technicals: Android Studio 3.1.4, Gradle wrapper 4.4, Android Gradle 3.1.4.

Answer

Change the order in which you define them in productFlavors. The IDE always loads the first flavor it finds there as the default.

We are here to answer your question about How to change Android Studio’s default build flavor? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji