https://kotlinlang.org logo
#ios
Title
# ios
i

Ilya

11/14/2023, 2:05 PM
Hello everyone! I'm getting some troubles with KMP/CocoaPods integration. I'm using some Objective-C library (e.g. "ObjLib") for my KMP project with
cocoapods { pod }
. But I need to distribute my KMP library as XCFramework to other team, where devs can't use cocoapods (only SPM). So I'm trying to deliver my KMP.xcframework with ObjLib.xcframework beside it. To create objc xcframework I'm using cocoapods build results for each platform from
build/cocoapods/synthetic/[platform]/build/Release-[sdk]/ObjLib/ObjLib.framework
The problem: in some cases (for example running gradlew from XCode Build Phases) there is no Info.plist file in ObjLib.framework, so final target application crashes with smth like "failed to load Info.plist from bundle ..." So the question - is there any chances to force creation of this file? Now only cleaning and syncing gradle project from Android Studio is helping... Or may be I'm doing smth extremely wrong... any advices?
t

Timofey Solonin

11/15/2023, 8:57 AM
Hi! Could you please see if this part of the documentation helps you? Most likely you don't want to use the build artifacts from
build/cocoapods/synthetic
, as these are implementation intermediates of the CocoaPods integration.
i

Ilya

11/15/2023, 12:09 PM
@Timofey Solonin thanks, but it's a bit different thing... I'm actually using
podPublishReleaseXCFramework
to build my KMP library xcframework, but this task doesnt help with ObjLib.xcframework. This task generates podsec file instead, so users of my lib have to use cocoapods too. But in my case users can only use SPM, so I'm trying to build all my cocoapods dependencies as xcframeworks too 🫠