Need help understand, when I am using iOS and havi...
# compose-ios
j
Need help understand, when I am using iOS and having a shared module. My shared module then depending on another Gradle KMP module which is using cocoapods. But it doesnt seem like those included into my shared build, to I need to export something special to make that magic happening? It says Could not find or use auto-linked framework. Earlier solved by include the assets into the iOS app build phase but not sure thats even correct. How should you do this? 😛
👀 1
a
use
api
instead of
implementation
in gradle to access shared module's dependency libs
j
I do, but doesnt help, same issue. Looks like cocoapods not linked properly in Gradle cocoapods dependency. Also tried export but didnt help. And error messages suck ... No idea whats wrong. Started with updated macOS and then iOS compose not building. Android target works fine.
a
I think then it is issue with how cocoapods are linked or supported in KMM IMO
j
Probably Yes. How do I debug it? Absolutely nothing in logs helpful except cocoapods libs and symbols not found. Any sample apps doing this can compare flags used?
a
What I know is If iOS raises symbol not found error, it means it has headers in the lib, but couldn't find the definition for them. Might need to check build setting flags being passed. I don't have a sample in my mind right now, but if I find one, I can provide to you
j
Yeah spent several hours tested a lot of flags in Xcode and project. I also tested upgrade cocoapods in homebrew to be sure. I use the cocoapods only internal in iosMain in my Gradle library internally. So not even using it in iOS app itself 😁
a
If your project is not big, or dependencies are little, may be try managing iOS deps without cocoapods and check if it works? https://kotlinlang.org/docs/multiplatform-ios-dependencies.html#add-a-framework-without-cocoapods
j
Yeah I want to use SPM but KMP not supporting it properly yet I think. Reference iOS libs inside KMP libs is complex. Thats reason unwillingly had to use cocoapods. Whatever works I am fine with. Just want to stop need to go back and check every time Xcode, cocoapods or libs updated. So annoying.
a
Agreed. I can feel your pain. Hope you find a permanent solution!
j
Btw does it matter if more modules depends on same? Having iOS depend on shared, shared on core. Then feature modules also depends on core. Core having the cocoapods deps.
Hmm ok interesting, by adding all of internal cocoapods libs into link libraries into binary manually in XCode it seems to work. Wow 😄
🎉 1
🦜 1
a
Wow great to know you were finally able to make it work! 🎉 But still cocoapods libs should not need to be added manually as far as I know. Great job!
j
Yeah they should be linked into binary exported to shared module used by iOS app. Very odd. Feels like adding only headers but not correct linking libraries. Mixing cocoapods and SPM.
a
Agreed