1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Built in Kotlinを有効にするとrealm-javaのkotlin-extensionsの依存が外れる

1
Last updated at Posted at 2026-02-05

タイトルの通りで依存が外れます。
realm-java の Plugin を使っていると自動で kotlin-extensions の依存が追加されるので意識することはないのですが、その処理が Built in Kotlin を有効にすると動かなくなるため、ビルド時に import ができずエラーになってようやく依存が外れたことに気づきます。

解決策

手動で kotlin-extensions の依存を追加することで回避可能です。

libs.versions.toml
realm-kotlin-extension = { module = "io.realm:realm-android-kotlin-extensions", version.ref = "realm" }

原因

Built in Kotlin の有効時に kotlin-android の Plugin を外すことで Realm 側で Kotlin のプロジェクトかどうかの判定処理が動かなくなるからです。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?