https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
b

Benjamin Charais

08/19/2022, 5:48 PM
On the topic of KMP builds that output a static framework, I have been having a heck of a time when combining the static output with a pulled in pod.
Copy code
framework {
            baseName = "RedShirt"
            isStatic = true
            embedBitcode(BITCODE)
        }

        pod("xxxxx") {
            moduleName = "xxxx"
        }
        useLibraries()
Using Kotlin
1.7.10
currently, the build goes swimmingly, and it very much seems that everything is in place, removing the pod, drastically impacts the output file size. I am running my output via
podPublishReleaseXCFramework
incase that has any bearing. The issue comes in when importing in XCode. It imports and references everything as expected, but when trying to build it will rarely, and intermittently work. The most common experience is the build failing with
arm64
errors around:
Copy code
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_UIDevice", referenced from:
      objc-class-ref in RedShirt(result.o)


Showing Recent Messages
Undefined symbol: _OBJC_CLASS_$_UIDevice
This error is not specific to arm, based on the build target. I haven't been able to track down any source on this kind of issue, everything is a brand new empty, and simple project. I don't believe I am missing anything, but this inconsistency is making things difficult.e
Looking deeper into this, the framework itself is being output as a
.o
when, I would expect that the marker,
isStatic
would output a
.a
86 Views