in the docs it says you need android studio to use...
# realm
m
in the docs it says you need android studio to use the kmp library. I use intellij for my multiplatform libs. is there anyway to make it work? https://www.mongodb.com/docs/realm/sdk/kotlin/install/kotlin-multiplatform/
n
It should work AFAIK if you have Intellij with the Android Support plugin.
m
I wasn’t able to get it to compile adding the plugin and dependencies.
ok I got it to work. it compiles anyway.
🎉 1
ok so it turns out I misspoke. I didn’t compile I just got the gradle sync to succeed. Once I tried to publish to maven local it failed. I get this error even though I’ve added
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt")
Copy code
Could not determine the dependencies of task ':compileKotlinIosArm64'.
> Could not resolve all task dependencies for configuration ':iosArm64CompileKlibraries'.
   > Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt.
     Required by:
         project :
         project : > io.realm.kotlin:library-sync:1.0.0 > io.realm.kotlin:library-sync-iosarm64:1.0.0
In the documentation it says to add
classpath("io.realm.kotlin:gradle-plugin:1.0.0")
to the build script of the project level build.gradle file however since I’m not using android studio I don’t have a project level build.gradle file. I’ve tried putting inside the settings.gradle similar to
com.android.tools.build:gradle:4.1.3
but it didn’t help. Not sure what else to even look at. Any ideas? Was anyone else able to get it to work from IntelliJ?
The way I got it to sync was to use
Copy code
id("io.realm.kotlin") version "1.0.0"
which is different to the documentation. But yeah seems I need to do something else also.
ok I was able to get it to compile in a new test library. I was also to reproduce this behaviour by adding ktor libraries. It seems ktor conflicts with
Copy code
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt")
not sure yet how to resolve that though.
it says to use
strictly
but it didn’t work. Not sure how to make ktor use that version. https://kotlinlang.org/docs/multiplatform-mobile-concurrency-and-coroutines.html#multithreaded-coroutines