I am kind of stuck on iOS packaging options and am...
# kotlin-native
k
I am kind of stuck on iOS packaging options and am looking for some help. The goal is to build static frameworks that can be published with cocoapods, but also possibly other options in the future. I've tried the following configurations (a thread):
Using the fat framework task. Adding just arm64 and x64. From that I make a zip and use pod repo push, which works. I can consume that, and it runs locally, but fails when attempting an archive. I abandoned that a couple days ago, but am going back to that now and will post more details.
Taking both generated frameworks from build/bin, and running
xcodebuild -create-xcframework
on them. This creates an XCFramework. Directly including that into xcode works for both simulator and device/archive. However, cocoapods fails on validating them. Also, xcodebuild doesn't like having both armv7 and arm64 in the same package. It says they're equivalent. I've heard XCFramework doesn't support "legacy" architectures, but have seen examples out in the wild that would disprove that theory.
Currently kind of stuck otherwise. Will keep exploring and try to produce a sample build.
May have some traction in another thread...
g
I couldn’t find a good solution either. However, to make creating an XCFramework simpler I created a Gradle plugin that takes care of that https://github.com/ge-org/multiplatform-swiftpackage
k
Ah, cool! Will take a look while that's fresh on the mind
d
@georg does your library only package up code built as part of MPP or is there a way to bring in swift files that are also part of the project?
k
I think we have our issue identified. Had nothing to do with fat framework. Appears to be something with the podspec, but confirming.
g
@drofwarcs it only packages the frameworks created by KMP
d
K. Thx