In Android world, I could add a dependency in a module, for any module which add this module as a dependency, it could use API from that dependency as will. e.g. facebook sdk -> utils module -> foo module -> main app module, both foo module & main app module could use facebook sdk API as well.
How do I did the same thing in multiplatform world (or in iOS world)?
facebook iOS sdk pod -> utils module -> foo module -> iOS main project
I’ve tried to add pod only in utils module, but neither foo & main could access facebook iOS API. If I add same pod in foo module, it can’t access Facebook API neither.
Or should I use another dependency management tool other than cocoapods?
2
Answers
You can only export a single Kotlin Xcode Framework. It’s kind of a "big binary" that has all of it’s dependencies. If "utils module" and "foo module" are both Kotlin modules, you should collect them into a single Kotlin Xcode Framework.
I guess you would like to have something like Export dependencies to binaries in the end. However, I’m not sure this will work for dependencies between Kotlin modules. For dependencies between them, I would recommend using the
api
dependencies link and adding pods for each module individually.I mean, core module’s build.gradle.kts should contain only
login module is having both cocoapods and core dependencies: