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

Carl Hickman

07/02/2020, 4:47 PM
I'm about to embark on creating a multiplatform library for ios and Android. I don't want to spin my wheels getting started. I'm worried about running into outdated documentation. Where is the most up-to-date information about getting started?
k

kpgalligan

07/02/2020, 4:56 PM
What part of getting started? What kind of library? Internal? Publishing concerns? Just iOS/Android?
c

Carl Hickman

07/02/2020, 5:00 PM
I have an iOS app and an Android app already in production. I'm looking to use Kotlin multiplatform to create libraries that deal mostly with logical issues... think data parsers and workflow management. Maybe even data storage at some point. What I am trying to determine now is if creating a library that can be commonly used for both apps is going to fit into the build process.
I could see using that library later for web concerns but that is not the goal
k

kpgalligan

07/02/2020, 5:06 PM
In general, the iOS side has more issues to consider. How big is the team, and if larger than 1, are the iOS devs expecting to not know anything about Kotlin or the build (as in, are you giving them a binary or do they need to build source?)
c

Carl Hickman

07/02/2020, 5:14 PM
The plan (or hope really) is to have the library built as a framework they could pull in with Carthage and SwiftPM if possible
k

kpgalligan

07/02/2020, 5:15 PM
I’m far more experienced with Cocoapods. I know some folks are using Carthage. Not sure about Swift PM.
The issue with pulling in a built framework, from my perspective, is you can’t really debug anything at that point, and from a team dynamics perspective, the “iOS devs” never really get on board with Kotlin. We’ve done configs where it works that way by default, but you can flip a switch and build Kotlin locally. Not sure how you’d configure that outside of cocoapods, but you could I’m sure.
I had a long thought piece that I was typing, but I’ll skip it. I think to get started it would be better to describe your source organization and desired build process, and see if anybody’s used that. You might luck out and find a detailed, “Here’s how we did this with monorepo and Carthage…“, but I don’t think theres’s a ton of production build config content out there yet, although there’s some. You’ll almost certainly have more luck finding somebody who’s done Carthage (or whatever) in the slack.
c

Carl Hickman

07/02/2020, 5:23 PM
Getting the iOS devs to buy-in to Kotlin is already going to be hard. I'll have to see about doing what you are suggesting... building Kotlin locally.
Yes, I need to narrow down the use case like you are saying... envision how the org and build process is going to play out. Thanks!
k

kpgalligan

07/02/2020, 5:25 PM
That’s why we had a dual config, so an iOS dev could just run the build without knowing anything about Kotlin. However, that puts an extra burden on whoever’s building the shared code. It needs to be extra well tested, etc, because if anything isn’t perfect, you’ll hear about it.
c

Carl Hickman

07/02/2020, 5:26 PM
Yeah, I bet. This proof of concept is going to have to be air tight if I want it to succeed
👆 1
k

kpgalligan

07/02/2020, 5:26 PM
I’ve talked to teams that were just making common Kotlin code and assuming the generated iOS library would work fine, but somebody really needs to understand the implications in a native context. Everybody doesn’t need to understand that, but you know.
I don’t know your particular situation, but I’d try to find somebody on the iOS side who’s at least curious. Get some collaboration.
c

Carl Hickman

07/02/2020, 5:27 PM
Will do. Thanks again for the advice
k

kpgalligan

07/02/2020, 5:27 PM
Good luck!
l

louiscad

07/04/2020, 8:34 AM
Is there a sample with that dual config you're mentioning @kpgalligan?
e

edenman

07/19/2020, 8:54 PM
i would also be interested in this ^