question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possibility to have realm-kotlin and realm-jvm in same project

See original GitHub issue

When some library (like Lokalise) is using realm-jvm under the hood it becomes impossible to use due to conflict between library and kmm modules which use realm-kotlin. Sample error log:

Duplicate class io.realm.BaseRealm found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.BuildConfig found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.Realm found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.RealmConfiguration found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.RealmConfiguration$Builder found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.RealmObject found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.RealmResults found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.log.LogLevel found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)
Duplicate class io.realm.log.RealmLogger found in modules jetified-library-debug-runtime (io.realm.kotlin:library-android-debug:0.1.0) and jetified-realm-android-library-10.0.0-runtime (io.realm:realm-android-library:10.0.0)

Possible solution: have different package name for realm-kotlin like io.realm.kotlin

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tarasmorskyi-mediamonkscommented, Nov 25, 2021

Oh, makes sense now. I was expecting usage of the same native parts and KMM being only a middleware for single codebase.

0reactions
rorbechcommented, Nov 24, 2021

The problem is that the native parts are not exactly the same, so we cannot just reuse the so-file in both SDKs. And as said, aligning them or finding a way where the two different versions can coexist is not on our current roadmap.

The obvious thing to do would be to migrate old libraries to Realm Kotlin when the required feature set is supported. Then it would just be a matter of aligning the versions in the dependencies.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Realm Kotlin Multiplatform SDK - The JetBrains Blog
At a high level, the Realm compiler plugin's main goal is to make defining Realm models as simple as constructing a regular Kotlin...
Read more >
Realm: Create reactive mobile apps in a fraction of the time
When Kotlin is used in a project, Realm automatically detects this and adds a number of extension methods that makes working with Kotlin...
Read more >
Realm Kotlin SDK - YouTube
Getting started with # Realm # Kotlin #Multiplatform SDK. ... Android as well as Kotlin Multiplatform projects (iOS, macOS, JVM and Android).
Read more >
Realm Kotlin Resolve$SymbolNotFoundError using inner ...
This is the weirdest bug I have ever had. If the enum has an Int attribute instead of a String one, it works....
Read more >
Kotlin: A New Hope in a Java 6 Wasteland - Realm Academy
Even then, if we do get Java 8 support in the next couple of years, it's going to be a while longer before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found