How to get Running Android Flavor Name in gradle script -


this time have problem, trying current flavor in gradle script. have tried answers given here how current flavor in gradle without luck.

i haven seen in answers use

// flavors android.productflavors.all { flavor -> if (flavor.name.equals("flavorname")) {     // } // ... } 

but didn't have luck because following error: > not unknown property 'android' task

so don't know how current flavor, appreciated thanks!!!

edit: need execute piece of code diferent each flavor, current idea know selected build variant in task, if there othe way perfect.

you can error if use out of "android" closure @ app level gradle script. make sure use inside


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -