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.

Gradle sync issues in Kotlin Multiplatform project

See original GitHub issue

Hi, I’m trying out the new Kotlin Multiplatform support but running in to a variety of gradle sync issues. I’ve tried the sample included and that seems to work. Are there known issues around this or any particular fixes planned?

Specifically I’ve created a branch of https://github.com/joreilly/PeopleInSpace and was starting initially to add in realm plugin/dependencies to gradle. I tried adding classpath for plugin in same way as other plugins (along with repositories update) but that seems to trigger ton of errors when syncing build.gradle.kts in kmp module. I also tried approach in sample but also get errors with that.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
joreillycommented, Apr 21, 2021

I tried following as test and seems to work (on both Android and iOS)

    fun fetchPeopleAsFlow(): Flow<List<Assignment>> {
        return callbackFlow {
            val callback = Callback<RealmResults<AssignmentDb>> {
                val allPeople = it.toList().map {
                    Assignment(name = it.name, craft = it.craft)
                }
                offer(allPeople)
            }
            realm.objects<AssignmentDb>().observe(callback)

            awaitClose {
            }
        }
    }

Updates pushed to https://github.com/joreilly/PeopleInSpace/tree/realm

0reactions
joreillycommented, Apr 29, 2021

Feel free to close this btw 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin multiplatform project gradle sync failed with "'pod gen ...
I try to make my first kmm project. But, It throws error while gradle sync process. Please help me. environment information. android studio...
Read more >
IntelliJ Kotlin multiplatform project Gradle sync very long
There's a known issue where Kotlin/Native dependencies are re-fetched every sync, which may be what you're seeing.
Read more >
Gradle sync fails when creating a new Kotlin project with ...
Coding example for the question Gradle sync fails when creating a new Kotlin project with default settings in freshly installed IntelliJ IDEA-kotlin.
Read more >
Kotlin Multiplatform project fails to import in AS 2022.1.1 Beta 1
Launch Studio and ask it to open only a few projects: ./studiow g; Wait for a few minutes. See that Gradle Sync fails...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Compilation issue in Kotlin multiplatform projects ... This section describes known issues related to project configuration and Gradle sync.
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