Hey again, Im having problem with cocoapods refere...
# multiplatform
a
Hey again, Im having problem with cocoapods referenced from kmm module i added PubNub pod to one of my kmm modules but then i tried to build ios iget this error
Copy code
Undefined symbol: _OBJC_CLASS_$_PubNub
Can you help me about that pls ty.
k
That error says the pubnub binary can't be found. Adding the pod to Gradle only tells cinterop about the headers. It should also add the dependency to your podspec. Are you using cocoapods for integrating into xcode?
I gave a talk about the difference between cinterop and linking (part of the talk anyway) https://www.droidcon.com/2022/08/01/sdk-design-and-publishing-for-kotlin-multiplatform-mobile-2/
a
You mean i also need to add cocopod dependency to iosApp PodFile ?
I ll look into it thank you very much
k
The podspec file that Kotlin generates should include a reference to whatever pod dependencies you have in the Gradle config. which should pull that into your overall cocoapods build and the Pods directory. Hard to say without looking at the whole thing. You can also add it to the Podfile directly just in case.
a
its included in the podspec file but its only works if i add the pod in the pod file manually
k
Odd. Looks like more of a cocoapods specific thing than kotlin. That should be able to access the dependency. I personally prefer to be specific with iOS dependencies in the 'Podfile' anyway. The iOS devs (if there are iOS devs) get to control versions and there aren't any surprise inclusions. Depends on the situation, though
a
there are some wierd stuffs going on there for example there is a method on the cinterop with 3 parameters but its actually 2 in the pubnub objectivec sdk
and using this method from iosMain breaks the compilation
maybe its better to implement that on ios and send to kmm over di with an intrface 🙂
thank you for your time Kevin and thank you to your team also 🙂