Bradleycorn
04/25/2023, 3:07 PMLibrary not loaded: shared.framework/shared
I think I understand why this happens, but I’m not sure how to fix it?
A bit more info in the 🧵Casey Brooks
04/25/2023, 3:12 PMBradleycorn
04/25/2023, 3:15 PMBradleycorn
04/25/2023, 3:18 PMpod 'sharedUiLogic', :path => '../sharedUiLogic'
That allows me to import shared
in my Swift code, and use the shared module logic in my ios framework project. Great.
Then I build the ios framework project into an xcframework, using xcodebuild.
that works to produce the xcframework, and I can setup all the cocoapods/github stuff to publish a pod that will use the framework.
But in doing so, it uses dynamic linking for the sharedUiLogic
“pod”. So when I use my published framework in another app, it will compile OK, but at runtime … 💥. Basically sharedUiLogic
is a dependency, and normally I’d setup my podspec to specify the dependency. But sharedUiLogic
is obviously not a published pod, so you can’t really specify it as a dependency.
I think I need to set sharedUiLogic
up to be linked statically? Also, I’m not sure how to do that.KamilH
04/25/2023, 4:29 PMcocoapods'
framework definition, you can set it to be static:
kotlin {
cocoapods {
(...)
framework {
isStatic = true
}
}
}