Realm-java: Is `kotlin-reflect` _really_ required?

Created on 6 Oct 2016  路  4Comments  路  Source: realm/realm-java

Goal

I would like to remove 11k methods from my dex count when using Realm in a Kotlin Android application.

Expected Results

Documentation should not require me to add kotlin-reflect as a dependency.

Actual Results

Documentation states that kotlin-reflect is required:

Many of Realm APIs reference Java classes, and for that reason you must include org.jetbrains.kotlin:kotlin-reflect:${kotlin_version} as a compile dependency.

I believe this is false because the ability to get a java Class<T> from a Kotlin KClass<T> is present in the Kotlin stdlib.

I've removed kotlin-reflect from my dependencies, ran a clean build, and the application still seemed to function normally.

T-Doc

Most helpful comment

I have been using Realm in my Kotlin application for a couple of months without the kotlin-reflect dependency, and it is working as expected.

All 4 comments

I have been using Realm in my Kotlin application for a couple of months without the kotlin-reflect dependency, and it is working as expected.

I won't rule out that it was left there, because it was needed at some point and we never got around to testing it without. We should update our documentation it seems.

Website and example updated.

Awesome, thank you for confirming!

Was this page helpful?
0 / 5 - 0 ratings