Hello! We're facing an issue where code completion and symbol recognition in Xcode doesn't work for our KMP library. Some details:
• The library is integrated in Xcode using a build phase script which runs the
embedAndSignAppleFrameworkForXcode
Gradle task
• The compiler knows about the library via the
FRAMEWORK_SEARCH_PATHS
and
OTHER_LDFLAGS=-framework TheKmpLibrary
settings
• Our Xcode project uses custom configuration names (not the standard
Debug and
Release), so we set
KOTLIN_FRAMEWORK_BUILD_TYPE
to map our configurations to build types accordingly
• Kotlin and KMP plugin version is 1.9.22.
Code completion doesn't work, nor can Xcode locate the header file when command-clicking on a symbol imported from the library - it just shows the dreaded
Giant Question Mark icon and burps.
What's interesting is that both of these functions work if we build the library as an XCFramework, and import it using the standard
Frameworks, libraries and embedded content mechanism in Xcode. This, however, is not a viable option in a monorepo where the KMP library is compiled from source alongside the Xcode project.
Any ideas? Are we missing something in our setup? Not having code completion is an absolute developer experience killer, especially with the name mapping from Kotlin to Swift.