Adding Ktor to a project seems also to include Kot...
# ktor
t
Adding Ktor to a project seems also to include Kotlin reflect. This makes the APK size much larger and adds Metadata annotations to all the classes which are visible when decompiling the APK. Is this intended behaviour?
😮 1
This is the dependency I added:
Copy code
implementation "io.ktor:ktor-client-core-jvm:1.2.0"
Looks like the reflection is used for the reified generics:
client.get<ResponseClass>{}
. I manually excluded
kotlin-reflect
in Gradle from my project, and as expected,
client.get
(put, post, delete as well) no longer works. I just need a
HttpResponse
so I can just use the
client.call
method instead (which does not use reflection). So for now, I have a solution.
2
Why does Ktor need Kotlin reflect? Why can't it just use Java reflection for this?
e
It looks like this dependency should be module local. Can you file an issue?
s
Yeah, the inclusion of kotlin-reflect in ktor-client-cio doubles the disk space used by my project’s shadow jar
t
🙏 1