# Problem using a published multiplatform library

**URL:** <https://discuss.kotlinlang.org/t/problem-using-a-published-multiplatform-library/23922>\
**Category:** Support\
**Created:** [January 14, 2022, 3:39pm UTC](https://discuss.kotlinlang.org/t/problem-using-a-published-multiplatform-library/23922 "2022-01-14T15:39:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soywiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/soywiz/32/9083_2.png) [@soywiz](https://discuss.kotlinlang.org/u/soywiz)\
**Post date:** [January 14, 2022, 3:39pm UTC](https://discuss.kotlinlang.org/t/problem-using-a-published-multiplatform-library/23922/1 "2022-01-14T15:39:42Z")

</div>

Hey folks, I have a problem/question related to multiplatform publishing.

We have a set of libraries: [GitHub - korlibs-archive/korge-next: Moved to https://github.com/korlibs/korge](https://github.com/korlibs/korge-next/) those libraries were all gradle submodules and published to central all at once for convenience. Now that some libraries are more mature and K/N supports has compatibility loading older library versions, we [wanted to move back some libraries to its own repos](https://github.com/korlibs/korge-next/issues/417).

It seemed to work and we were able for example to [publish klock again in its own repo](https://github.com/korlibs/klock/releases/tag/v2.4.12) [available on central here](https://repo.maven.apache.org/maven2/com/soywiz/korlibs/klock/).  
And artifacts seems to be published successfully, one artifact per platform.

But after trying to change the submodule with the published version, a strange error started to happen (like imports weren’t found):

```auto
> Task :korio:compileNativeCommonMainKotlinMetadata FAILED
e: /Users/runner/work/korge-next/korge-next/korio/src/nativeCommonMain/kotlin/com/soywiz/korio/async/FutureExt.kt: (3, 19): Unresolved reference: klock

```

[Full log on CI](https://github.com/korlibs/korge-next/runs/4801427852?check_suite_focus=true#step:6:621)

The thing that I have noticed is that the task name is called `compileNativeCommonMainKotlinMetadata`, so it seems to be covering the nativeCommon sourceset. There is no artifact for that nativeCommon, so maybe it cannot find any suitable library for that code. But why that task happening at all? Why it is not compiling only once for each platform and that’s it?  
How can I solve this problem? Should I publish library variants for every single group of targets? ie. “nativeCommon”, “appleCommon”, “posixCommon”, “nativeNonMingw”, “nonJvm”, “nonJs”… I have a lot to avoid code duplication.

Any of you had this problem, and know how to solve that either by adjusting the published library or the code consuming it?

Thanks in advance!
