Hello! Does anyone know of any public iOS multi-mo...
# ios
g
Hello! Does anyone know of any public iOS multi-module project (with multiple .xcodeproj files) that also uses KMP? I’m looking for a sample project where each module depends on the shared (and possibly multiple) XCFramework. I want to study it as I’m showcasing KMP to my iOS team colleagues, and this was one of their questions (my background is in Android). Thanks for your help! ps: any blogpost/article is also welcome.
may i consider this a success?
with spm also
r
Hi @Guilherme Delgado! Would you mind sharing your sample? I'm have linking errors when trying to use a shared KMP with multiple modules 😞
g
Hello @Rue Harper! Can you share your errors output? This was a simples example I don't have it anymore 🫣 😓
r
Ah I was trying to make it work last week, I also now don't have the output anymore 😆 I remember that it was an issue with using the generated XCFramework in two targets (main app target and a Framework being used as a feature module). I suspected it was an issue with the
embedAndSignAppleFrameworkForXcode
gradle step as if it ran for only one of the targets then it'd be usable within that target, but: • Running it for both (or running it for one, then including the generated framework in the other) wouldn't work
Ah I was trying to make it work two weeks ago, so now I also now don't have the output anymore 😆 I remember that it was an issue with using the generated XCFramework in two targets (main app target and a Framework being used as a feature module). I suspected it was an issue with the
embedAndSignAppleFrameworkForXcode
gradle step as: • Running it for only one of the targets then it'd be usable within that target, but not ideal because I'd like to use the shared KMP code for multiple modules • Running it for both targets wouldn't work because it'd have a duplicated framework with different IDs which caused issues when validating a build ready to upload to App Store Connect • Running it for the main app target then including the generated framework in the feature module didn't work because of a
dyld: library not loaded
crash when installing to device I'm going to give it another try at the end of the sprint so hopefully I'll be able to go further with it, maybe I was overcomplicating it before... I appreciate any guidance you have for making a multi-module set up work @Guilherme Delgado 🙂
g
I’m about to publish an article about that, not specifically for multi-module, but the sample is multi-module (both shared and iOS), so it might help 🙂 I’ll share the link when published
I hope to publish it this week 😉
r
That'd be super helpful! Thanks very much 😄
Hi @Guilherme Delgado! I was wondering, did you publish that article? 😄
g
hope it helps 😉
r
I'll get back to you when I manage to take another look - much appreciated, thanks! 🙂
👍 1
Hi @Guilherme Delgado! Just wanted to let you know the article helped solve the issue I was having! I set up a pre action in the build scheme to embed the framework, and it solves needing to have the main target built first before being able to use it in a feature module. Greatly appreciated, thanks 🙂
g
Awesome! Glad I could help 😊
❤️ 1