kotlin-result: Multiplatform ArtifactNotFouundException

I’m trying to import com.michael-bull.kotlin-result:kotlin-result:1.1.8 in the commonMain source set in a multiplatform project, but the gradle build is failing with this stacktrace:

Gradle import errors project ‘:web’: Unable to build Kotlin project configuration Details: org.gradle.internal.operations.BuildOperationQueueFailure: There was a failure while populating the build operation queue: Could not find kotlin-result-1.1.8-samplessources.jar (com.michael-bull.kotlin-result:kotlin-result:1.1.8). Searched in the following locations: https://repo.maven.apache.org/maven2/com/michael-bull/kotlin-result/kotlin-result/1.1.8/kotlin-result-1.1.8-samplessources.jar Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find kotlin-result-1.1.8-samplessources.jar (com.michael-bull.kotlin-result:kotlin-result:1.1.8).<eol>Searched in the following locations: https://repo.maven.apache.org/maven2/com/michael-bull/kotlin-result/kotlin-result/1.1.8/kotlin-result-1.1.8-samplessources.jar

I’m using the same dependency in another (JVM-only) project and it works perfectly. Is there something I’m missing with multiplatform configuration that will solve this? Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

I ran into this issue with mockk also. FYI, I created https://youtrack.jetbrains.com/issue/KTIJ-10769.

@moeindev this is a general Kotlin MPP problem, see: https://youtrack.jetbrains.com/issue/KTIJ-10769

Anyone found a solution for this problem? I’m having the same problem trying to import my kmm library into my android project!

I can confirm one more thing sourcesjar issue happens if the lib doesn’t have all targets which your projects targets.

Thanks @Shabinder - knowing that you can depend on this library from an android project without problems is very useful to know 👍. I am tempted to close this issue going forward until somebody submits a reproducible case, as I still can’t exactly diagnose the issue reported in the OP on my own computer nor can I find any information as to what this “sourcesjar” thing is.

@michaelbull Hey as I said earlier , I was facing same issue with my library and today I fixed it , So I tried to test your project too as I hoped I could maybe help.

But after adding a dependency on this Lib it compiled successfully. I have jvm,js,androidTarget as of now in my project where I tested.

If Anybody could share a reproducer , I am more than happy to help and even create a PR if i could fix the issue

PS: if you want to add an Android Target too , I can do that and then maybe those who are facing the issue can test again, adding android target in my project fixed the Issue too

Something else to note, what targets have you specified for your mpp build? You mentioned a project/module called :web: Should be mentioned that while kotlin-result is now an mpp project it currently only builds artifacts for jvm based mpp projects (so jvm and android). There is currently no js target - if thats something you want you could open an issue requesting it or a pull request.