Using Kotlin 1.6.21 I'm adding dependencies to my `commonMain` source set, but Intellij 2022.1 can't...
e
Using Kotlin 1.6.21 I'm adding dependencies to my
commonMain
source set, but Intellij 2022.1 can't resolve them (building via command line works fine). Android Studio Bumblebee works fine. Is that expected?
Copy code
plugins {
  kotlin("multiplatform")
}

kotlin {
  explicitApi()

  js {
    browser()
    nodejs()
  }

  jvm()

  sourceSets {
    val commonMain by getting {
      dependencies {
        implementation(<http://libs.ktor.io|libs.ktor.io>)
      }
    }
    val jsMain by getting
    val jvmMain by getting
  }
}
a
Hi! Can I see the error message? Screenshot should work
e
If I open the project in Intellij after opening it in AS Bumblebee it works, but the following notification is shown:
If I
Fix and re-import project
the ktor code no longer resolves
a
🤔 I've seen that before. For some reason, this issue occurs even after the upgrade of Intellij. Do you use Toolbox? If so, can you try to download the latest Intellij from the official website (https://www.jetbrains.com/idea/download) When opening it make sure you don't import previous settings. Just make it brand new. And try again? Let me know if it works. Also, try removing
.idea
folder before opening in new IDEA
e
I am using Toolbox. Downloaded the latest version from https://www.jetbrains.com/idea/download but when I run it from
bin/idea.sh
it seems to be using all the settings from the Toolbox installation (opening the most recently opened project, theme, key mappings, etc...). In any case, it is still broken.
a
e
Done, and still broken
a
Ok 😞 . Then I will try to reproduce it and let you know if I find anything. In any case, I would be grateful if you could report that issue to YT: https://youtrack.jetbrains.com/issues/KTIJ
e
Do you think downgrading the Kotlin plugin to 1.6.10 would help?
a
Not sure. I found the issue where I've seen a case like yours. https://youtrack.jetbrains.com/issue/KT-48148/HMPP-Gradle:-Unresolved-reference-to-any-class-from-kotlinx.coro#focus=Comments-27-5978676.0-0 It seems that just restoring to the default settings didn't work. You also have to clean up Android Studio 😕 Anyway, it seems like a serious issue with AndroidStudio and IDEA that somehow conflict with each other. We need to investigate that.
e
Interesting, so in that case it was the other way around, where Android Studio wasn't working. I'll file an issue.
Disabling Gradle's configuration cache seems to have fixed the issue 🙁