I added a new buildType called “qa” in gradle and it inherits from release.
android {
buildTypes {
debug {
}
qa {
initWith release
debuggable true
}
release {
}
}
}
dependencies {
debugImplementation "com.github.chuckerteam.chucker:library:4.0.0"
qaImplementation "com.github.chuckerteam.chucker:library:4.0.0"
releaseImplementation "com.github.chuckerteam.chucker:library-no-op:4.0.0"
}
I want QA builds to allow chucker HTTP traffic monitoring enabled. However, I get duplicate classes error:
Duplicate class com.chuckerteam.chucker.api.BodyDecoder found in modules library-4.0.0.aar -> library-4.0.0-runtime (com.github.chuckerteam.chucker:library:4.0.0) and library-no-op-4.0.0.aar -> library-no-op-4.0.0-runtime (com.github.chuckerteam.chucker:library-no-op:4.0.0)
Is it because the qa build type has “initwith” release and the no-op version of the library is also added to the classpath that causes duplicate classes error?
The build task is ./gradlew assembleQa
.
How do I exclude the no-op version of the dependency when I just building Qa type build?
Note: I am not using kotlin dsl here. Debug/release builds are fine.