Need help in KMM! We’re building a kotlin multipl...
# multiplatform
r
Need help in KMM! We’re building a kotlin multiplatform project for audio/video (WebRTC) use case which will be used by native(android/iOS) app developers as a SDK. On android side we’re good. But on iOS side we are facing some challenges. We are using external local dependencies developed in swift. We’ve integrated those via cocoa pods. Now those classes are accessible for us in
iOSMain
which is ideal. But when we try to generate framework file of our
Shared
module, We think It does not include headers for the externally added dependencies. So our clients on their iOS apps need to add those dependencies along with our
Shared
framework. We wish to avoid this and create a unified framework which includes nested dependancies. So far we tried creating an umbrella framework project, where we added our
Shared
framework and other dependancies and then tried to create framework, it did not work as expected. We’ve tried to explain the problem using attached image. Please drop us a message here if you need any more information regarding same.
k
https://www.droidcon.com/2022/06/28/sdk-design-and-publishing-for-kotlin-multiplatform-mobile/ The talk title is wrong on the site, it's about bridging native sdks. There's a section on cinterop. You're (probably) not missing "headers" but binary. SPM and cocoapods have dependency mechanisms that let you specify what other things a user of your library may need. You need to figure out how to include that in your publishing, or configure your native build to link your dependencies directly, which can be problematic.
This is kind of like building a fat jar in jvm land rather than getting the maven/Gradle dependencies configured. You can do it, but it may be a bad idea. However, hard to say without working on it.