Home > Software design >  Intellisense not working in Kotlin Multiplatform Library
Intellisense not working in Kotlin Multiplatform Library

Time:11-10

I have a kotlin multiplatofrm library that is included into an Android and iOS app.

In my android project include it as a composite build (MyLib). But Intellisense is not working at all for all code from in MyLib, though the whole thing compiles fine. I am using Android Studio. What could be wrong and how can I debug it?

rootProject.name='xxx'

includeBuild 'MyLib'
include ':common'
include ':app'

MyLib's build.gradle.kts looks as follows:

plugins {
    kotlin("multiplatform") version "1.5.31"
    kotlin("native.cocoapods") version "1.5.31"
}

repositories {
    mavenCentral()
    maven { setUrl("https://dl.bintray.com/kotlin/kotlinx.html/") }
}

group = "com.xxx.MyLib"
// CocoaPods requires the podspec to have a version.
version = "1.0"


kotlin {
    ios()
    jvm {
        compilations.all {
            kotlinOptions.jvmTarget = "1.8"
        }
        testRuns["test"].executionTask.configure {
            useJUnit()
        }
    }
    cocoapods {
        ios.deploymentTarget = "11.4"
        frameworkName = "MyLib"
        summary = "xxx"
        homepage = "xxx"

        podfile = project.file("../../iOS-App/Podfile")
    }
    sourceSets {
        commonMain {
            dependencies {
                implementation("org.jetbrains.kotlin:kotlin-stdlib:1.5.31")
                implementation("com.badoo.reaktive:reaktive:1.2.0")
                implementation("com.badoo.reaktive:reaktive-annotations:1.2.0")
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")
                implementation("com.russhwolf:multiplatform-settings-no-arg:0.8.1")
                implementation("net.swiftzer.semver:semver:1.1.1")
            }
        }
    }
}

tasks.withType<GenerateModuleMetadata> {
    enabled = true
}

CodePudding user response:

I think this is likely related to enter image description here

Another part is the Kotlin Gradle Plugin dependency: org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0-RC2

And last but not least I had to downgrade the corouting dependency (from 1.5.2): org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC

After that everything was back to normal.

  • Related