I have compileOnly Jackson in the build.gradle with something like this:
dependencies {
CompileOnly ‘Jackson’
}
However, I can still find Jackson lib in classes.dex when analyzing apk and it caused duplicated class issue (I have another apk providing Jackson class and used at run time)
Some observations:
- I’ve tried to remove implementations that has dependencies with Jackson, but Jackson is still imported in apk.
- only classes that are directly called by apk package are imported in classes.dex (not the whole Jackson lib)
- I cannot exclude Jackson because it will cause build fail.
Is it possible that classes are directly called by the apk package are included in apk, even if I used compileOnly?