Since we can't add multiple K/N projects as depend...
# kotlin-native
p
Since we can't add multiple K/N projects as dependencies in a single multiplatform project, what is the best way to achieve this. I am currently using export method to create a common framework and then using kotlin-native-cocoapods plugin to add it to the multiplatform project. However, if I use kotlin-native-cocoapods to create the framework, it is not able to combine other K/N projects. Any solution for the above?
a
Hello! Can you please clarify, what exactly do you want?
m
p
thanks @Michal Harakal. I thought about this method of adding all the files as source set. I would surely try that. I was just thinking that if we can use an export function to create a big framework without stitching, can we use the same method in cocoapods plugin as well?
But yes, that is a difficult method..
Thanks for your response, btw
🙂 1
m
I’m not sure, if this is the right approach, but works for me…
p
ok. thanks
a
Is this to say you can publish as a Framework fine? Is the cocoa pod plugin the thing not working?
p
Publishing the framework is fine. I have to tweak the cocoapods plugin generated Podspec to refer to framework generated by packForXcode task. That seemed hacky, that's why wanted a better approach. Definitely stitching the modules is better than that but even better would be to have a way in cocoapods plugin to have a way to export other projects.
hey @Michal Harakal have you tried creating a dynamic framework using cocoapods instead of static framework? Does it work?
m
@Prateek Grover no, I didn’t, but according official docs it should be possible. As far I’ve understood, it is a natural way on desktop targets, so it should work on iOS too. But thank you for the question, so I’ve learn about use cases for dynamic libs on iOS…
@Prateek Grover there are some news regarding dynamic libs https://github.com/JetBrains/kotlin-native/issues/2422#issuecomment-514234984
p
thanks michal. checking it out