Greetings, Last week, I asked about getting the <...
# multiplatform
e
Greetings, Last week, I asked about getting the https://github.com/Kotlin/kmm-with-cocoapods-sample example to build. After upgrading to 1.9.23, I was able to get my project to compile with a local podspec. However, the ios build fails at the link stage with:
Copy code
ld: warning: Could not find or use auto-linked framework 'pod_dependency': framework 'pod_dependency' not found
Undefined symbols for architecture arm64:
  "_foo", referenced from:
      _cocoapods_pod_dependency_foo_wrapper0 in ComposeApp[arm64][2](ComposeApp.framework.o)
Is there an extra flag or step which is necessary to make the code in the _pod_dependency_ visible to the linker?
l
@hhariri I think you want to rename that GitHub " KMM" project 😉
h
Oops.
a
@Eric Smith could you share the exact build command and the revision you're trying to build? The project is buildable for me with any Kotlin version
e
My problem is not with the kmm-with-cocoapods-sample project itself. I’m trying to add a local CocoaPod dependency to my own project, and using the _pod_dependency_ from the sample project as a template. The command that’s failing is the Xcode link step: `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios14.1-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk -O0 -L/Users/zig/Projects/econ2k-kmp/build/ios/EagerLinkingTBDs/Debug-iphonesimulator -L/Users/zig/Projects/econ2k-kmp/build/ios/Debug-iphonesimulator -F/Users/zig/Projects/econ2k-kmp/build/ios/EagerLinkingTBDs/Debug-iphonesimulator -F/Users/zig/Projects/econ2k-kmp/build/ios/Debug-iphonesimulator -F/Users/zig/Projects/econ2k-kmp/iosApp/../shared/build/xcode-frameworks/Debug/iphonesimulator17.4 -F/Users/zig/Projects/econ2k-kmp/iosApp/../composeApp/build/xcode-frameworks/Debug/iphonesimulator17.4 -filelist /Users/zig/Projects/econ2k-kmp/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/KotlinProject.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/zig/Projects/econ2k-kmp/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/KotlinProject_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/zig/Projects/econ2k-kmp/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/KotlinProject.swiftmodule -framework composeApp -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/zig/Projects/econ2k-kmp/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/KotlinProject.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/zig/Projects/econ2k-kmp/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/KotlinProject.app-Simulated.xcent.der -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/zig/Projects/econ2k-kmp/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Objects-normal/arm64/KotlinProject_dependency_info.dat -o /Users/zig/Projects/econ2k-kmp/build/ios/Debug-iphonesimulator/KotlinProject.app/KotlinProject``
a
Do you use CocoaPods integration to Xcode (https://kotlinlang.org/docs/native-cocoapods-xcode.html)? Combining direct integration (
embedAndSign
task) and CocoaPod-dependencies is not supported.
e
I’m sorry, I don’t understand. That page appears to be about exposing a KMP project as a CocoaPod. My goal is to import an existing CocoaPod as dependency for my KMP project. (Actually, the ultimate goal is to import an SPM dependency into my KMP project, but that appears to be unsupported.)
a
The problem is that there is a limitation that you can't import a Pod dependency without exposing the project itself as a Pod. We would love to allow that, but it complicates things too much.
e
Thanks. I wasn’t aware of that limitation. I’ll give that a try.