Setting buildType attribute for specific flavour at android studio

156 Views Asked by At

Is it possible to change a buildType attribute like debuggable for a specific build flavor?

I am trying setting it up using applicationVariants like this:

applicationVariants.all { variant ->
    if (variant.name == "flavorQuaRelease") {
        variant.buildType.debuggable = true
    }
}

but got this error:

Cannot set readonly property: debuggable for class: com.android.build.gradle.internal.api.ReadOnlyBuildType

Looks like a dead end.

I have 4 flavours, 2 build types. If i do by adding another build type i will have 24 different build options. Too much. Should be a better way to do it.

0

There are 0 best solutions below