Any ideas what might be causing this? ```e: Could ...
# compose-web
g
Any ideas what might be causing this?
Copy code
e: Could not find "org.jetbrains.compose.web:web-svg" in [C:\Users\Greg\AppData\Local\kotlin\daemon]
e: java.lang.IllegalStateException: FATAL ERROR: Could not find "org.jetbrains.compose.web:web-svg" in [C:\Users\Greg\AppData\Local\kotlin\daemon]
Full Stack trace:
Copy code
e: Could not find "org.jetbrains.compose.web:web-svg" in [C:\Users\Greg\AppData\Local\kotlin\daemon]
e: java.lang.IllegalStateException: FATAL ERROR: Could not find "org.jetbrains.compose.web:web-svg" in [C:\Users\Greg\AppData\Local\kotlin\daemon]
        at org.jetbrains.kotlin.ir.backend.js.KlibKt$toResolverLogger$1.fatal(klib.kt:117)
        at org.jetbrains.kotlin.library.KotlinLibrarySearchPathResolver.resolve(SearchPathResolver.kt:175)
        at org.jetbrains.kotlin.library.SearchPathResolver$DefaultImpls.resolve$default(SearchPathResolver.kt:20)
        at org.jetbrains.kotlin.library.SearchPathResolverKt.resolve(SearchPathResolver.kt:29)
        at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl$resolveDependencies$2$2.invoke(KotlinLibraryResolverImpl.kt:122)
        at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl$resolveDependencies$2$2.invoke(KotlinLibraryResolverImpl.kt:122)
        at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
        at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
        at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
        at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
        at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
        at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
        at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786)
        at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:816)
        at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:807)
        at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl.resolveDependencies(KotlinLibraryResolverImpl.kt:135)
        at org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl.resolveWithDependencies(KotlinLibraryResolverImpl.kt:44)
        at org.jetbrains.kotlin.ir.backend.js.JsLibraryResolverKt.jsResolveLibraries(JsLibraryResolver.kt:51)
        at org.jetbrains.kotlin.ir.backend.js.ModulesStructure.<init>(klib.kt:509)
        at org.jetbrains.kotlin.ir.backend.js.KlibKt.prepareAnalyzedSourceModule(klib.kt:407)
        at org.jetbrains.kotlin.ir.backend.js.KlibKt.prepareAnalyzedSourceModule$default(klib.kt:394)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:239)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:178)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:71)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.incremental.IncrementalJsCompilerRunner.runCompiler(IncrementalJsCompilerRunner.kt:193)
        at org.jetbrains.kotlin.incremental.IncrementalJsCompilerRunner.runCompiler(IncrementalJsCompilerRunner.kt:78)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:357)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:299)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:118)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:169)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:80)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile$default(IncrementalCompilerRunner.kt:71)
        at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execJsIncrementalCompiler(CompileServiceImpl.kt:564)
        at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execJsIncrementalCompiler(CompileServiceImpl.kt:100)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1802)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
If it helps, the dependency causing this is dev.petuska:kmdc-checkbox (from the kmdc project), which is a library I have published to my local maven repo (although I am not using the dependency in my code).
I have also tried explicitly adding
implementation(compose.web.svg)
to my build.gradle.kts, but get the same result with or without it.
o
this reminded me about https://youtrack.jetbrains.com/issue/KT-49959 what compose and kotlin versions do you use?
g
kotlin 1.6.10 and compose 1.0.1
o
Is it known what kotlin version was used to build the kmdc that you added as a dependency? The guess is that kmdc dependency might've been built with older kotlin (the guess comes from the issue 49959) If the issue is still there, then could you please share either some repro or your build.gradle?
g
I built kmdc myself, using the save versions for kotlin and compose. Could there be a common dependency other than kotlin and compose, that when the versions are mismatched, cause this error?
o
what steps do I take to try to reproduce? • build kmdc from master to mavenLocal? • create new project with compose for web (kotlin 1.6.10, cfw 1.0.1) + include kmdc dependency from mavenLocal • build the project? are there any other specific details? In the meantime, I'll try the steps above
g
Yes, and only the components that use svg (I am trying to use kmdc-checkbox) induce the problem. But I have done the same thing, and cannot reproduce it with a minimal project. So I need to further troubleshoot the build that is having the issue.
o
got it. I was able only to repeat the same error as in the issue 49959 by creating a project with kotlin 1.5.31 and compose 1.0.0 with latest kmdc (built using kotlin 1.6.10 and compose 1.0.1): Could not find "kotlin" in [/Users/oleksandr.karpovich/Library/Application Support/kotlin/daemon] but it works properly when I use 1.6.10 and 1.0.1 everywhere. just in case, what ./gradlew dependencies shows in your case?
Copy code
\--- dev.petuska:kmdc-checkbox:0.0.0
     \--- dev.petuska:kmdc-checkbox-js:0.0.0
          +--- org.jetbrains.kotlin:kotlin-stdlib-js:1.6.10
          +--- org.jetbrains.compose.web:web-svg:1.0.1
          |    \--- org.jetbrains.compose.web:web-svg-js:1.0.1
          |         +--- org.jetbrains.compose.web:internal-web-core-runtime:1.0.1 (*)
          |         +--- org.jetbrains.kotlin:kotlin-stdlib-js:1.6.10
          |         +--- org.jetbrains.compose.web:web-core:1.0.1 (*)
          |         \--- org.jetbrains.compose.runtime:runtime:1.0.1 (*)
          +--- dev.petuska:kmdc-core:0.0.0
          |    \--- dev.petuska:kmdc-core-js:0.0.0
          |         +--- org.jetbrains.compose.runtime:runtime:1.0.1 (*)
          |         +--- org.jetbrains.compose.web:web-core:1.0.1 (*)
          |         \--- org.jetbrains.kotlin:kotlin-stdlib-js:1.6.10
          \--- dev.petuska:kmdc-form-field:0.0.0
               \--- dev.petuska:kmdc-form-field-js:0.0.0
                    +--- org.jetbrains.kotlin:kotlin-stdlib-js:1.6.10
                    +--- dev.petuska:kmdc-core:0.0.0 (*)
                    \--- dev.petuska:kmdc-ripple:0.0.0
                         \--- dev.petuska:kmdc-ripple-js:0.0.0
                              +--- dev.petuska:kmdc-core:0.0.0 (*)
                              \--- org.jetbrains.kotlin:kotlin-stdlib-js:1.6.10
g
I found the issue, but I am not sure why it was a problem. I was using a buildSrc plugin to pull in the kotlin multiplatform plugin and repositories. In repositories, I had gradlePluginPortal() listed before mavenCentral(). Removing gradlePluginPortal() allowed the build to succeed. If instead I didn't use the plugin and included the multiplatform plugin and added gradlePluginPortal() to the repositories directly in my build.gradle.kts, the build would succeed. So that is what I don't understand fully, because I would think the end result from those two methods (in build.gradle.kts vs included via buildSrc) should be the same. I also ran the dependencies task on the version that worked and on the version that didn't work. Then I ran a diff on the output of each. This is what I got (repeated a few times):
Copy code
169,173d168
< |    \--- org.jetbrains.compose.web:web-svg-js:1.0.1
< |         +--- org.jetbrains.compose.web:internal-web-core-runtime:1.0.1 (*)
< |         +--- org.jetbrains.kotlin:kotlin-stdlib-js:1.6.10
< |         +--- org.jetbrains.compose.web:web-core:1.0.1 (*)
< |         \--- org.jetbrains.compose.runtime:runtime:1.0.1 (*)
314c309
< |         +--- org.jetbrains.compose.web:web-svg:1.0.1 (*)
---
> |         +--- org.jetbrains.compose.web:web-svg:1.0.1
The left file was the version that built successfully.
This is line 168 in both files:
Copy code
+--- org.jetbrains.compose.web:web-svg:1.0.1
Bottom line: Don't put gradlePluginPortal() where it shouldn't be anyway
o
thanks for sharing your results. that's a bit strange that gradlePluginPortal in buildSrc could cause this. Did you have gradlePluginPortal for plugins or for dependencies?
g
buildSrc/build.gradle.kts has gradlePluginPortal() in the repositories{} block. I also had it in the repositories block in the file buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts. I was pulling that into my build with id("multiplatform-setup") in the plugins block. I removed it from the file src/main/kotlin/multiplatform-setup.gradle.kts, where it isn't necessary, and then the build worked.
179 Views