Hello guys, I’m trying to share some code between ...
# kotlin-native
t
Hello guys, I’m trying to share some code between Android and iOS apps and my final goal is to have a completely detached kotlin project in a different repository that could generate a
jar
for android and a
framework
for iOS. Is there a way to do that currently with kotlin multiplatform/native? (the sample projects are all very coupled)
t
Yes it is, we create aar for Android and zip with framework for iOS and upload them to internal maven repo
t
Great @thevery! Do you have a sample or article explaining how to setup something like that?
t
I can probably contribute android part into https://github.com/JetBrains/kotlin-mpp-example but iOS depends on your final project anyway
t
I am looking do the exact same - output lib and framework. @thevery what do you mean above when you say “iOS depends on your final project”?
t
@tylerwilson it is super easy to add maven aar dependency to gradle and not so easy to add framework on iOS (there are many ways to do this)
t
I see. I figured putting it up in a local repo as a binary cocoapod would be simplest for us. I thought you were suggesting that the framework would have to have some knowledge of the app it is used in.
t
We use the same maven as for android and store pod file in main project repo, but lookingfor some better solution as well