Solution 1 :
Can you share your Project Level Gradle ?
You can exclude this way also
configurations {
compile.exclude group: "junit", module: "junit"
}
Problem :
I have a TestFixture
module that contains shared Test dependencies for different modules in my application. However, this module is completely unnecessary in my release build as my application (outside of testing) never references any of the items in it.
Is there a way to exclude this TestFixture
module from my release build?
All my modules
testImplementation project(':testfixtures')
TestFixture module
implementation project(':app')
implementation project(':server')
implementation project (':data')
implementation project(':cache')
implementation project(':core')
implementation "androidx.test.ext:truth:$androidxExtTruthVer"
implementation "com.google.truth:truth:$truthVer"
// Testing Moshi
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
implementation "com.squareup.moshi:moshi:$moshi_version"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
... Other implementations