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

Samuel Michael

09/20/2020, 6:40 PM
Anyone have any experience adding Multiplatform framework to a iOS workspace which uses Carthage for managing frameworks?
It seems like pack for Xcode is not working because of the way the frameworks get added via Carthage, I am trying the CocoaPods plugin to circumvent this just checking if anyone had some tips
s

spierce7

09/20/2020, 7:04 PM
I have done this successfully with carthage
Carthage allows a pre-compiled framework
s

Samuel Michael

09/20/2020, 7:05 PM
Awesome, how do I add pre-compiled framework to Carthage?
is it in the CartFile or somewhere else I’m a little out of my element
s

spierce7

09/20/2020, 7:07 PM
the documentation is inconsistent on it
so it took a lot of trial and error
s

Samuel Michael

09/20/2020, 7:07 PM
😞
s

spierce7

09/20/2020, 7:07 PM
so you want to compile a fat framework
a fat framework has all the different cpu abis in it. Kotlin native gives you a gradle task to do that
Then you basically zip up the framework, and do a github release with the .framework.zip file in the release files
s

Samuel Michael

09/20/2020, 7:10 PM
And then I suppose follow normal Carthage instruction for adding framwork zip from github repo?
s

spierce7

09/20/2020, 7:10 PM
carthage can then point at the repository, and it will pull from the sem ver release tag from github
if you look at what carthage pulls, it gives you the compiled frameworks - I think you find the unzipped farmework in there
Carthage has a lot of limitations around this
hope this helps though
s

Samuel Michael

09/20/2020, 7:11 PM
Thanks 🙏 This is very helpful, hoping I can figure it all out
s

spierce7

09/20/2020, 7:11 PM
I haven’t done this since q1 this year
but I was able to figure it out both times pretty easily with the help of someone from my ios team who knew carthage
oh - you know what it was!
There was another way of releasing precompiled frameworks that I could never get working too. The Firebase iOS teams use it. You could try copying them
s

Samuel Michael

09/20/2020, 7:13 PM
Cool I will try to get some help from some iOS devs on my team tomorrow
Thank you very much for your help
OH - a few gotchas that I’m remembering
I was creating the zip file with the gradle / java zip support - That didn’t work. carthage couldn’t unzip the file when I created a zip that way
s

Samuel Michael

09/20/2020, 7:16 PM
Ah that is confusing, have to zip a certain way
s

spierce7

09/20/2020, 7:16 PM
I had to use a mac specific zipping command. I never got the zip to work any other way
s

Samuel Michael

09/20/2020, 7:16 PM
okay that is good to know
d

dazza5000

09/21/2020, 12:47 PM
I need to do this today. Thank you for talking it through.
How do you build a framework that contains arm64 and x86 binaries?