freeman
freeman

Reputation: 94

How to set applicationid for different flavor and buildtype?

I have

2 flavors

and

5 buildtypes

I would like to set full applicationId to be

I use kotlin-dsl ,Please help

Upvotes: 0

Views: 2607

Answers (1)

Balwinder SIngh
Balwinder SIngh

Reputation: 1971

update your build.gradle to below

   android {
 
   flavorDimensions "flavors" , "enviornment"

    productFlavors {
        flavor1 {
            dimension "flavors"
             applicationId "com.example.flavor1"
         }
        flavour2 {
            dimension "flavors"
            applicationId "com.example.flavor2"
        }
        dev {
            dimension "enviornment"
            manifestPlaceholders.appName = "(DEV)"
            applicationIdSuffix 'dev'
        }
        debug {
            dimension "enviornment"
            manifestPlaceholders.appName = "(Debug)"
            applicationIdSuffix 'debug'
        }
        uat {
            dimension "enviornment"
            manifestPlaceholders.appName = "(UAT)"
            applicationIdSuffix 'uat'
        }
        preprod {
            dimension "enviornment"
            manifestPlaceholders.appName = "(PreProd)"
            applicationIdSuffix 'preProd'
        }
       release {
            dimension "enviornment"
            manifestPlaceholders.appName = "(your app name)"
        }
    }
}

Upvotes: 0

Related Questions