https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
m

Mark Vogel

02/14/2023, 5:05 PM
I have a multiplatform library that I published to my private repository. My source set names are
common
server
and
browser
. When publishing I changed the artifact ID to
project
,
project-jvm
and
project-js
respectively so it would automatically pick them up for the platform. In the multiplatform project where I'm using the library I can access everything perfectly on the
common
and
server
(JVM) modules, but for some reason in the
browser
(JS) module I can't access the library at all. Has anyone else encountered this kind of thing? I can confirm that all 3 packages are published to the repository
a

Adam S

02/14/2023, 5:36 PM
When publishing I changed the artifact ID to
project
,
project-jvm
and
project-js
respectively so it would automatically pick them up for the platform.
Gradle doesn’t select the Kotlin variant based on the artifact suffix, it uses Gradle module metadata https://stackoverflow.com/q/73914158/4161471 Whether this is related to your problem or not, I don’t know…
m

Mark Vogel

02/14/2023, 5:40 PM
I see! Good to know. I will change those back and see if it fixes anything and report back
So it does indeed work without the suffixes. However, the issue for the JS platform still persists. Any further insight you can think of?
a

Adam S

02/14/2023, 5:52 PM
what’s the error?
m

Mark Vogel

02/14/2023, 6:11 PM
No error. My IDE just doesn't resolve any imports from the dependency on the JS platform
Okay I just realized this is something specifically wrong with my PC. For some reason with the IR compiler IntelliJ won't resolve any dependencies in the JS module of multiplatform. If I have the same project on my other PC it will resolve them. Do you have any insight on what I can reset/delete/invalidate to fix this? I've already completely uninstalled IntelliJ and invalidated all caches with the built-in tools, but the issue persists
Note: this happens for all multiplatform projects using the IR compiler on my PC. I appreciate your input, but it looks like that was the main issue for my original issue.
a

Adam S

02/14/2023, 6:26 PM
so running
./gradlew build
works fine, it’s just IntelliJ?
m

Mark Vogel

02/14/2023, 6:26 PM
Correct
a

Adam S

02/14/2023, 6:26 PM
weird
try deleting the caches in
$HOME/.gradle/
maybe
m

Mark Vogel

02/14/2023, 6:27 PM
Yeah I'll load the same project on another PC and everything resolves fine in IntelliJ too
a

Adam S

02/14/2023, 6:27 PM
sometimes IntelliJ stores caches in there
m

Mark Vogel

02/14/2023, 6:27 PM
I did try that as well earlier with no luck
Deleted the %appdata% IntelliJ install locations too
a

Adam S

02/14/2023, 6:28 PM
are there any errors in the IntelliJ log?
m

Mark Vogel

02/14/2023, 6:28 PM
Not sure. Where can I find that?
m

Mark Vogel

02/14/2023, 6:31 PM
Yeah looks like there some griping about cache timeouts and the
fileHashes.lock
. Then farther down some AccessDeniedExceptions
Copy code
Lock file: C:\Users\mark.vogel\Projects\ntc-assets\.gradle\7.5\fileHashes\fileHashes.lock

2023-02-13 23:29:24,861 [48235676]   WARN - #c.i.o.v.i.l.LocalFileSystemBase - C:\Documents and Settings
java.nio.file.AccessDeniedException: C:\Documents and Settings
I can upload the whole file if that might help identify it
a

Adam S

02/14/2023, 10:16 PM
it’d probably better to make an issue on YouTrack, with the log
m

Mark Vogel

02/14/2023, 11:31 PM
Sounds good. Thanks for the help!