Hello all, I have switched from the JS to the multiplatform plugin for my JS projects with the chan...
d
Hello all, I have switched from the JS to the multiplatform plugin for my JS projects with the change to Kotlin 1.9 as recommended. I have now set the dependecies within the Kotlin config block in the build.gradle.kts to:
Copy code
kotlin {
  js(ir) { ... }

  sourceSets { 
    val jsMain by getting { 
        implementation(project(":shared"))
        implementation(project(":jsshared"))
        ....
    }
  }
}
Building via Gradle also still works. But in IJ only the classes from external dependencies are recognised and all dependencies from the own projects are underlined in red as missing. I have this in the current beta in the preview and also in the stable IJ version. How do I get IJ to recognise the own subprojects again? They are also missing in the project settings under Dependencies in IJ.
a
just to double check the basics, have you tried all of these options? • running
./gradlew clean
• making sure that
./gradlew clean
deletes
$projectDir/build/
• deleting the
.gradle
directory inside the project • restarting IntelliJ • running Repair IDE • restarting your machine
d
Unfortunately, I have tried all of them. I also deleted the .gradle directory and reinstalled IJ (and removed the %APPDATA% as well). With a new installation, the loading and indexing of the project (with 27 sub-projects) then takes about 30 minutes. The problem also occurs with another colleague.
a
hmm bummer. If it’s happening on two machines it sounds like there might be something with your project that is tripping up IntelliJ and/or Kotlin. Have you checked the idea.log and Kotlin compiler logs for any obvious problems?
d
The scan entries actually look reasonable in the log:
Copy code
2023-07-18 12:09:40,842 [8600373]   INFO - #o.j.s.e.g.GradleProjectDependenciesModel - Collecting dependencies for :buildSrc:main
2023-07-18 12:09:40,842 [8600373]   INFO - #o.j.s.e.g.GradleProjectDependenciesModel - Collecting dependencies for :buildSrc:test
2023-07-18 12:09:40,842 [8600373]   INFO - #o.j.s.e.g.GradleProjectDependenciesModel - Finish collecting all modules, count of found modules: 34
2023-07-18 12:09:47,475 [8607006]   WARN - #c.i.o.o.e.ConfigurableExtensionPointUtil - ignore configurable with duplicated id: device.file.explorer
2023-07-18 12:09:47,476 [8607007]   WARN - #c.i.o.o.e.ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
2023-07-18 12:09:47,586 [8607117]   INFO - STDOUT - 
2023-07-18 12:09:53,383 [8612914]   WARN - #c.i.o.o.e.ConfigurableCardPanel - auto-dispose 'Kotlin' id=preferences.language.Kotlin
2023-07-18 12:09:54,552 [8614083]   INFO - STDOUT - 
2023-07-18 12:09:56,076 [8615607]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-07-18 12:09:56,173 [8615704]   INFO - #c.i.u.s.SvgCacheManager - SVG icon cache is closed
2023-07-18 12:09:56,193 [8615724]   INFO - #c.i.i.s.e.u.EventLogExternalUploader - Started external process for uploading event log
2023-07-18 12:09:56,298 [8615829]   INFO - #c.i.c.ComponentStoreImpl - Saving Project(name=xy, containerState=COMPONENT_CREATED, componentStore=C:\projektdateien\xy)ProjectView took 59 ms
But errors keep being thrown that look like they relate to IJ's status window:
Copy code
2023-07-18 12:09:40,767 [8600298]   INFO - #o.j.s.e.g.GradleProjectDependenciesModel - Collecting dependencies for :dtoVorabanfrage:test
2023-07-18 12:09:40,767 [8600298]   INFO - #o.j.s.e.g.GradleProjectDependenciesModel - Collecting dependencies for :fachgutachter:main
2023-07-18 12:09:40,767 [8600298]   INFO - #c.i.o.p.u.AbstractProgressIndicatorBase - This progress indicator (Resolving known external annotations 1090234331: running=true; canceled=false; task=org.jetbrains.plugins.gradle.service.project.data.ExternalAnnotationsDataServiceKt$resolveProvidedAnnotations$$inlined$runBackgroundableTask$default$1@4362f821) is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress. class com.intellij.openapi.progress.impl.BackgroundableProcessIndicator
java.lang.IllegalStateException
	at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.setFraction(AbstractProgressIndicatorBase.java:197)
	at com.intellij.openapi.progress.util.AbstractProgressIndicatorExBase.setFraction(AbstractProgressIndicatorExBase.java:110)
	at com.intellij.openapi.progress.util.ProgressWindow.setFraction(ProgressWindow.java:319)
Where can I find the compiler logs? (Note: the project can be built with Gradle).
a
I’ve not done it myself, but try build reports: https://blog.jetbrains.com/kotlin/2022/06/introducing-kotlin-build-reports/
d
The report do not help 😞
Copy code
Gradle start parameters:
  tasks = []
  excluded tasks = []
  current dir = C:\projektdateien\\portal
  project properties args = [android.injected.build.model.only.advanced: true, android.injected.build.model.disable.src.download: true, org.gradle.kotlin.dsl.provider.cid: 17902310850600, android.injected.invoked.from.ide: true, android.injected.build.model.only.versioned: 3, kotlin.mpp.enableIntransitiveMetadataConfiguration: true, idea.gradle.do.not.build.tasks: false, android.injected.build.model.only: true]
   system properties args = [idea.active: true, java.awt.headless: true, idea.resolveSourceSetDependencies: true, idea.sync.active: true, idea.version: 2023.2]




No Kotlin task was run