Is it possible to somehow use cocoapods gradle plu...
# ios
l
Is it possible to somehow use cocoapods gradle plugin to import some Objc dependencies and use it in my common code, and do not export the cocoapods dependency down to the iOS app?
a
You will never be able to access ios items in common target, but you could use an expect and actual to do the ‘functionality’
l
Thanks for replying. Sorry I meant that I wanted to use the iOS dependencies in my Kotlin code, as opposed to swift
a
ah i see, then unfortunately no.
because at run time, the kotlin code will be looking for that dependancy
and will crash when it cannot find it
imagine the code that is generated, it would have an import statement at the top, referencing the dependancy, but obviously it would not be bundled with the app
i guess the closest thing i could relate it to, is when you include a framework in an ios project, but you dont bundle that framework in the project. Then you go to run it on a device and it crashes, because it was trying to use the framework
l
Yeah that’s fair, I was hoping that I could have something like runtimeOnly such that I can maybe still declare the dependency on Xcode through Swift Package Manager, as to avoid Ruby issues that usually accompanies Cocoapods projects
a
sorry, you can do that, you should be able to use SPM in your native project without cocoapods
cocoapods is only used on KMM to generate the ‘api’ of your dependancy
a
You should be able to use cocoapods plugin to declare dependencies and use “regular” Xcode integration via embedAndSignFramework task at the same time.