Hello! I’am trying to use AppCode to edit kotlin a...
# multiplatform
s
Hello! I’am trying to use AppCode to edit kotlin and swift. The Gradle sync compete successful but i don’t get reference resolve between kotlin and swift. The possible wreaking places can be message in gradle log:
Copy code
Top-level Android dependencies are not supported – please declare the dependencies for an individual source set.
And message from AppCode (doesn’t shows in gradle log)
Copy code
Collection contains no element matching the predicate.
AppCode 2022.2 Build #OC-222.3345.144, built on August 2, 2022 com.jetbrains.appcode.android (222.3345.144) com.intellij.appcode.kmm (222.3345.144)
j
Did you manage to solve this? I'm currently facing the same problem
s
Don’t resolved. AppCode better works with only Kotlin plugin. Not with AppCode Kotlin Multliplatform plugin
j
I see, thanks for the quick answer. I guess I'll try to see if the EAP version fixes anything, else I'll just keep using xCode.
(just a small update, still broken in EAP)
s
What helped me is moving the dependencies into
kotlin / sourceSets
block and use the KMP plugin instead of the android plugin.
Copy code
// androidApp/build.gradle.kts

plugins {
    kotlin("multiplatform") // instead of kotlin("android")
    id("com.android.application")
    //...
}

kotlin {
    android()
    sourceSets {
        val androidMain by getting {
            dependencies { 
                implementation(project(":shared"))
                // other app dependencies
            }
        }
    }
}

android {
  // android configuration
}