Reputation: 410
I have an iOS dynamic framework built using Kotlin Multiplatform. I can successfully link against it, build and run with it. However, when archiving, Xcode throws the error: ld: bitcode bundle could not be generated because '/path/to/framework' was built without full bitcode.
The following rule is used in our build.gradle.kts file for the framework:
iosArm64 {
binaries {
framework {
embedBitcode("bitcode")
}
}
}
According to other threads, I can check if a framework has bitcode using the following:
$ otool -l libName.o | grep __LLVM
which yelds:
segname __LLVM
segname __LLVM
That should mean there's bitcode inside.
Does anybody have an idea why Xcode fails to detect bitcode inside the framework?
Upvotes: 0
Views: 422
Reputation: 410
Found the answer. Kotlin Multiplatform creates release and debug versions of your targets. The debug version only has bitcode markers while the release version has full bitcode embedded. And I was trying to archive with the debug version of the framework. If I use the release version for archiving, no errors are thrown. The otool
method only shows if there are markers which are there in both cases.
Upvotes: 1