Hi guys. I’m building a kmm library that lets you ...
# multiplatform
l
Hi guys. I’m building a kmm library that lets you encrypt a bunch of things. For iOS, that means using CryptoKit, which is a Swift only library. With success I’m using the Swift Klib Gradle Plugin (https://github.com/ttypic/swift-klib-plugin) to be able to use CryptoKit in shared kotlin library code. However, problems arise when trying to publish the library. I’m using the standard
"maven-publish"
plugin without any additional configuration. Is that even the right way to publish a multiplatform library? I couldn’t find many resources about it (and I’m more of an iOS developer by nature so the gradle things still confuse me sometimes). When running the
publishToMavenLocal
task I’m getting
Unresolved reference
errors for all the Swift binding code (in
native/*
) I’m importing from my
iosMain
Kotlin code. It appears the publish plugin doesn’t work together with the swift-klib-plugin. Or is there something else I need to do? When building a shared KMM project inside the same gradle project and using the library through a
project
dependency all works fine. Any help or advice would be greatly appreciated!