Build multi flavors project

(Evgeny Nefedov) #1

Hallo! i have a problem about building project.
I try write android application with Flavors. But i can’t found resolution for my problem.
My problem is
i have project with java code, this project have dependencies with another models for example like this
dependencies {

this project have 2 productFlavors
productFlavors {
flavor1 {}
flavor2 {}

next my “flavor1” have binary dependencies with module B
its look like this

dependencies {

but on this case i have conflict in project…

dependencies {
implementation(’:B’) <-- conflict
flavor1Implementation(name:‘B’,ext:‘aar’)<-- conflict

my question is - How can i say to gradle “if current flavor is flavor1 use aar files - if flavor2 use module dependencies” ?
example diogram like this
sorry about my English :blush: