-
Notifications
You must be signed in to change notification settings - Fork 68
Kotlin 2.1.0 support #1857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
same here :( |
same here! |
Bump, version 3.0.0 has the same issue |
same here with gradle 8.11.1 and agp 8.7.3 |
The same with realm-kotlin 3.0.0 |
same issue here. Any plans to fix this? |
Maybe @nhachicha would give an answer? |
Guys, i have been using room for very small requirements but wanted to try realm is it worth it as it's documentation is very bad and it is not supporting kotlin 2.0 or higher |
Looks like realm is not maintained anymore - #1852 (comment) |
it does support or at least works for me on Kotlin 2.0.21
they say that it is minimum maintenance, maybe there are still some hopes? I'd rather switch to Room than maintain fork of realm |
it doesn't work for me |
Same issue for me. Any word on this? |
Is anyone here maintaining a fork with up to date dependencies? I'm very happy with realm and need no more features but don't want to stuck with an updated kotlin version |
I looked in the code, there is this comment: // This is the K2 equivalent of our PSI hack to determine if a symbol has a RealmObject base class. Tried to check about the link, but it requires an account in slack with an email address: @jetbrains.com
Not sure how to get it yet. |
Kotlin 2.0.20 works for me, just have trouble with Kotlin 2.1.0 |
You can join the slack via this survey https://surveys.jetbrains.com/s3/kotlin-slack-sign-up or you can see the messages here https://slack-chats.kotlinlang.org/t/15702763/hi-i-am-trying-to-update-a-compiler-plugin-with-k2-support-a without registration |
from Comtributing.md:
|
I took a stab at it, but the Realm compiler uses a ton of internal Kotlin compiler functions/classes (not just the public APIs). Many of the internal code's signatures, visibilities, package names, and generic type parameters changed from 2.0.20 -> 2.1.0. The more I tried to change things to match the new signatures, the more things broke, and I don't know nearly enough about the internals of the Kotlin compiler to be able to say it was even done correctly with any level of confidence. Mongo laid off their Realm leads and the devs were either also let go or reassigned, so probably no help from any of them anytime soon. Our only hope might be if someone from JetBrains who knows the Kotlin compiler inside and out decided to give it a try. |
I just got it built on Linux with 2.0.20 but with gradle 8.11 and Java 17. Things appear OK so far. They didn't have Linux build scripts coded in, that's why they mentioned it's not supported? I do see a couple messages like:
I guess the major issue is still with the compiler plugins. I see that there are both frontend and backend plugins implemented. I haven't looked much in detail (and I don't have lots of internal knowledge of Kotlin), I'd suppose the frontends are easier issues than the backends. |
Build with 2.0.21 on Linux appears also OK. Test outputs look the same as with 2.0.20, with the same errors:
Anyone see these differently when building on the Mac, or take these as issues? Next, will build with 2.1.0 and see what happens. |
Build with 2.1.0 got 55 build errors, but the good news is they are only restricted in 7 files. Error log is attached. |
One issue I ran into was with the Gradle version. I got some errors after bumping to 2.1.0 that seemed to stem from the old versions of Gradle not playing well with the new version of Kotlin. When I bumped the Gradle version to the latest, it seemed to address it. I had to make some tweaks to the various build.gradle.kts files as well. The one file in the Realm compiler that gave me particular issues was I wish you luck! |
This comment has been minimized.
This comment has been minimized.
first push of the rebranding is here: https://github.com/XilinJia/krdb Looking to resolve some upload issue with maven central. In the meantime, if you clone this project, you can publish to local maven from the root directory with:
and something like: I'd like to hear if there are issues. |
thanks again for your hard work! that's how far I got on macos. haven't tried on liunux yet:
|
@SimonSchubert seems to me that you didn't do: |
Nice it looks like it's working for android 👍 not for my multiplatform (android/ios) project as you suggested already before |
I don't have a way to test on ios or macos. Do you have more details when it doesn't work? What happens when you do: |
this is failing for me when I call ./gradlew publishToMavenLocal :
when I try to add the realm dependency to my shared module it doesn't seem to find any ios realm dependencies |
Can't say much about MacOS, but it's likely your CMake issue? Did you check about system requirements in Contributing.md? |
system requirements look fine. I will give it another try tomorrow |
Hi! I've tested this on both android and iphone. To fix the issue mentioned by @SimonSchubert i removed x86_64 in cinterop/build.gradle.kts |
I had to add the dependencies for all the mac platforms to the build.gradle in the cinterop module to make it for for ios/macos afterEvaluate {
tasks.getByName("sourcesJar").dependsOn(generateSdkVersionConstant)
tasks.named("androidReleaseSourcesJar") {
dependsOn("generateSdkVersionConstant")
}
tasks.named("jvmSourcesJar") {
dependsOn("generateSdkVersionConstant")
}
tasks.named("iosArm64SourcesJar") {
dependsOn("generateSdkVersionConstant")
}
tasks.named("iosSimulatorArm64SourcesJar") {
dependsOn("generateSdkVersionConstant")
}
tasks.named("iosX64SourcesJar") {
dependsOn("generateSdkVersionConstant")
}
tasks.named("macosArm64SourcesJar") {
dependsOn("generateSdkVersionConstant")
}
tasks.named("macosX64SourcesJar") {
dependsOn("generateSdkVersionConstant")
}
} |
Does Android work for everyone? I got it working and build a release Android app with the local maven. But I'm having trouble to reproduce that. Somehow, the newly built maven artifacts contains a librealmc.so that misses lots of symbols with RealmJNI for Android, and the Android app crashes just after start. I can't figure out what the issue is yet. |
I am currently getting
@XilinJia is this the same error you get? |
Yes, precisely. I can't understand what's happening. I had built 3.2.3 (at least before pushing to github) and that worked. I still have the apk, once unzipped having the librealmc.so containing the symbol realmcJNI. Now, I tried to build multiple times various versions 3.2.4, 3.2.3 rebuilt, and even the not-rebranded https://github.com/XilinJia/realm-kotlin. The librealmc.so in ~/.m2/repository/xxx/cinterop-android/xxx/cinterop-android-xxx.aar all lack the symbol. I can't figure out why. Seems the only change I haven't tested since I first built 3.2.3 is a system upgrade of Manjaro Linux (but how can that change it?) What's your situation @hansfritzi |
I use Mac OS 15.3.1 and the not-rebranded version because i have some conflicts in my project that i wanted to override. |
This is amazing. Thank you! @hansfritzi I spent more than a day with:
only to fail at the Android app. realm.kotlin.buildRealmCore is already set to true in files. Will find out why publishToMavenLocal doesn't trigger full build for Android. |
krdb is finally published to maven central. For descriptions, see: https://github.com/XilinJia/krdb |
Hey @XilinJia, really appreciate the efforts, but wanted to ask if you are also planning to sign the CLA ? mentioned in #1860. While its a good approach to fork and fix it, it seems like a more temporary than longer term solution and keeping up the community branch in the realm repository seems like the best approach maintance wise in long term. |
I asked the question if the CLA is needed for the community branch as I thought it's not necessary. @AlexKatonaVisma, are you the maintainer of the repo and ready to merge the PR just waiting for me CLA? If that case, I'd be happy to do. |
@XilinJia , no I am just a disappointed Realm user. But maybe one of the top contributors could help there? @cmelchior @rorbech @clementetb @nhachicha ? |
Given that mine PR (#1851) with CLA is still not merged / released, and last release happened 6 month ago -- I wouldn't expect active realm maintenance. We maintain our own fork for now, and gradually migrating to room |
Any update on this? |
krdb has bugs too. As far as I can see, there's no easy way out of this. I'm going to have to downgrade my project, migrate all users to another persistence solution and eventually remove it entirely. |
@EranBoudjnah I migrated a major multiplatform project from realm to room a few weeks ago. got it all working but just to find out that certain implementations didn't work well when I copied them 1 to 1 from realm to room. couldn't afford to spend any more time on it and reverted back to realm |
The best long term solution is to migrate away from Realm, we decided to do that recently and migrating it with the help of AI agent, it works great so far |
In the long term none of us have a choice if we want to keep updating our Kotlin versions. |
Migrated to Room as well. It was easier than I thought, even though I had to reimplement some of the old stuff |
DI (Koin) Threading (Coroutines) Settings/User Defaults (Prefs) Navigation (Voyager) Networking (Ktor) DateTime (DateTime) Realm (Unmaintained works only with kotlin 2.0.20 realm/realm-kotlin#1857"
DI (Koin) Threading (Coroutines) Settings/User Defaults (Prefs) Navigation (Voyager) Networking (Ktor) DateTime (DateTime) Realm (Unmaintained works only with kotlin 2.0.20 Check: realm/realm-kotlin#1857"
Is there a strategy or solution in place to address this issue? |
No you have to fork the repo
|
How frequently does the bug occur?
Always
Description
After update to kotlin 2.1.0, my project doesn't compile.
Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
2.3.0
What Atlas App Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Macos Sequoia 15.1
Build environment
Android Studio version: 2024.2.1
Android Build Tools version: ...
Gradle version: 8.10.2
The text was updated successfully, but these errors were encountered: