Remove jar in certain build type
dependencies {
compile files('libs/xxxx.jar')
}
android.applicationVariants.all { variant ->
if (variant.buildType.name.equals("release")) {
variant.dex.libraries = variant.dex.libraries - files('libs/xxxx.jar')
}
}