Set applicationIdSuffix depending on product

We have 2 productFlavors (testServer, liveServer) and 2 build types (debug, release).

Due to existing API keys, I need to add package names based on buildType + productFlavor.

For example, something like:

 buildTypes { debug { applicationIdSuffix '.dbg' + (testServer ? '.test' : '.live') } release { applicationidSuffix '' + (testServer ? '.test') } } 

Is it possible? as?

+3
source share
1 answer
 productFlavors { testServer { applicationId = "com.example.my.pkg.test" } liveServer { applicationId = "com.example.my.pkg.live" } } buildTypes { debug { applicationIdSuffix ".debug" } } 

For more information, see the Android documentation regarding application identifiers.

+4
source

All Articles