Hey folks! Is it possible to use a cocoapod depend...
# multiplatform
t
Hey folks! Is it possible to use a cocoapod dependency in a module in multi-module kmp setup? We have the following setup:
Copy code
- composeApp (shared, gets embed into the iOS project)
-- moduleA
-- moduleB
-- moduleC <- (here I want to use cocoapod dependency)
m
Hey! A bit unrelated but i was trying to use the new CMP resource api in a multi module project (same as you described above). It broke the build and i found out only the composeApp module can access the new resource api for now. So my approach currently: Have an interface (representing the cocoapod dependency) specified in moduleC of what you expect. Use it via koinInject in moduleC. But provide it in the composeApp module via a koin module single<CocoapodLibInterface> {Real()} Works for me
t
Yeah, that's the only approach rn I think. I, however, wanted to use types from the dependency also, without wrappers. Seems impossible 😄
m
Even if you get it to work, I would not count on it being reliable enough for production while things in the KMP/CMP world evolve quickly. Was my conclusion at least. I’m gonna have all gradle build magic happen in the composeApp module and work my way around this contraint
👍 1
t
I wonder why multi-module features are low-priority, considering the fact that people almost immediately started to build multi-module projects using KMP
m
good point! One of the highest selling points of KMP over Flutter for me is it’s enterprise readieness thanks to gradle and the great multi module capabilities. I guess Jetbrains soon catches up on that. Would waste resources if you build a new feature directly for multi-module envs and then decide to change it altogether. I guess they decided for speed in shipping features instead
(which i can understand)
t
Yep, agreed. I hope that once they improve multi-module support in compose gradle plugin, resources and dependencies will automatically work 😄