When packaging iOS, Xcode reports an error indicating Bitcode version incompatibility?
Problem Description
When packaging and exporting an iOS App with Xcode, Xcode reports the following error:
ipatool failed with an exception: ...... bitcode-build-tool ......Or the following error is reported during compilation and linking:
Failed to verify bitcode in XXXX.framework/XXXX (XXXX is the product name of the integrated ZEGO SDK, such as ZegoExpressEngine)Problem Cause
-
Because Apple requires iOS Apps submitted to the AppStore to not be built with outdated toolchains and iOS SDKs (i.e., using lower versions of Xcode), ZEGO updates the version of the toolchain used to build ZEGO SDK in real-time (such as Xcode). When the version is lower, this error will occur.
-
Bitcode is a technology that can be used to reduce App package size. Xcode enables this feature by default (i.e., in the Xcode project, the "Enable Bitcode" option in "Target > Build Setting" is set to "Yes" by default). However, this feature has high requirements for binary compatibility and does not support backward compatibility. Therefore, developers cannot use a lower version of Xcode to build an iOS App integrated with ZEGO SDK when the Bitcode feature is enabled.
When selecting "Window > Organizer > Archive > Distribute App (Export)" on Xcode, if "Include bitcode" or "Rebuild from bitcode" is checked, an error will be reported indicating Bitcode processing failure.
Solution
-
Upgrade Xcode to the latest version. (Recommended)
-
Open the Xcode project and set the "Enable Bitcode" option to "NO" in "Target > Build Setting". (Not recommended)
