Hi all. I'm researching Kotlin Multiplatform for a...
# multiplatform
g
Hi all. I'm researching Kotlin Multiplatform for an upcoming project. I want to share business logic across 3 existing apps on three different platforms - Android, iOS and web (VueJS). I've followed this tutorial for creating a basic multiplatform library. Now I want to integrate this library into the 3 apps, but I'm unsure how. Is there a blog post, video tutorial etc that covers this for all three platforms? Thanks!
a
just found this article to integrate a KMM module on iOS
👍 2
p
Are the consumer Apps also using the kotlin multiplatform plugin or not? - if not using the kotlin multiplatform plugin is a bit more challenging but if using the kotlin multiplatform plugin is a matter of pushing the library to a maven repo and just add the dependency on the client App.
p
How do your iOS teams expect to consume 3rd party libraries currently? Swift Package Manager (SPM) is most likely the front-runner but Cocoapods is also pretty common. If you want to publish your code as a binary framework then I would. suggest you take a look at Touchlab’s KMMBridge tooling
g
thanks @Alejandro Rios. Do you know of a similar tutorial for web apps? e.g Let's say I have an existing web app written in VueJS, and I want to create a Kotlin Multiplatform library, then use the library's methods from my web app. How would I go about that?
thanks for the resource @psh. Ideally SPM, but Cocoapods would work too. I'll have a look into it
s
@Graham for Kotlin/JS output, you may look at this post where I have tried to define all options to distribute and integrate the lib https://dev.to/touchlab/different-ways-to-distribute-and-integrate-kotlinjs-library-1hg3
👍 1
a
just found this article to integrate a KMM module on iOS, fresh from the oven 😂 (edited)
@Alejandro Rios When trying to integrate cocoapods in a kmm module i am getting the following error:
org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/IdeaProjects/multiplatform-lib/build.gradle.kts' line: 1
Plugin [id: 'org.jetbrains.kotlin.native.cocoapods'] was not found in any of the following sources:
Anything i am missing ?
g
much appreciated @shaktiman_droid