First off, I want to state that without bitcode , everything is working perfectly. The problems start when I turn on the "bitcode" flag in the app.
Also, all of the builds are through a CI flow (not manually inside xcode->archive et.al).
The framework is built in a separate flow from the app itself (The app embeds the compiled framework)
I'm getting this error when I try to package the ipa:
❌ ld: bitcode bundle could not be generated because '..../Framework.framework/Framework' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture armv7
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
Regarding the Framework:
I'm building the framework using the following command: (omitting technical details)
# iphone (arm)
xcodebuild -configuration Release -sdk iphoneos CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
# iphone (simulator)
xcodebuild -configuration Release -sdk iphonesimulator CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
and then lipo (FAT binary)
lipo -create /Release-iphonesimulator/Framework.framework/Framework -output /Universal/Framework.framework/Framework
I've added the compiler flag to the framework to "embed bitcode"
And I even "validated" it has bitcode per other S.O. questions: (Compiling iOS library with bitcode enabled)
Also, the easiest way to check if the binary contains bitcode is to use otool and grep:
otool -l binary_name | grep __LLVM
you will see one or more segname __LLVM entries if it does have bitcode or empty output if does not.
otool -arch arm64 -l Frameworks/Framework.framework/Framework | grep __LL
segname __LLVM
segname __LLVM
I've also tried the other variation of added a compile flag
xcodebuild OTHER_CFLAGS="-fembed-bitcode"
and had identical error reported to me