Hi everyone, I'm trying to product flavours to an ...
# android
e
Hi everyone, I'm trying to product flavours to an android library. On adding couple of flavours say freeVersion flavour and PaidVersion flavour android { flavorDimensions "user" productFlavors { freeVersion { dimension "user" versionNameSuffix "-free" } paidVersion { dimension "user" versionNameSuffix "-paid" } } sourceSets { main { java.srcDirs = ['src/main/java'] res.srcDirs = ['src/main/res'] } freeVersion { it.java.srcDir "src/freeVersion/java" it.res.srcDirs = ["src/freeVersion/res"] } paidVersion { it.java.srcDir "src/*paidVersion*/java" it.res.srcDirs = ["src/*paidVersion*/res"] } } } getting build error FAILURE: Build failed with an exception. * What went wrong: Task 'testDebugUnitTest' is ambiguous in root project 'Utopia' and its subprojects. Candidates are: 'testfreeVersionDebugUnitTest', 'testPaidVersionDebugUnitTest',
not kotlin but kotlin colored 3
m
It's literally in the error output. There are two debug test source in this case, paid and free thus ambiguity
d
right, you’ve to have the full variant in the command, not just the build type. e.g
test${flavor}${buildType}UnitTest
where you’ll most often have
${buildType} = "Debug"