Why does building a project with iOS simulator fail in Xcode 12.3 and above?
Problem Description
In Xcode 12.3 and above, when integrating SDK and building a project using iOS simulator, you may receive the following error:
Building for iOS Simulator, but the linked and embedded framework 'xxx.framework' was built for iOS + iOS Simulator.Problem Cause
-
Starting from Xcode 11.0, Apple allows but does not recommend bundling multi-platform binary frameworks or libraries into a single ".framework" file.
-
Starting from Xcode 12.3, Apple does not allow binding multi-platform libraries in a single ".framework" file. You must use ".xcframework" file instead.
Solution
Solution 1: Upgrade SDK (Recommended)
Starting from ZEGO Express SDK 2.8.0, iOS/macOS SDK is delivered with XCFramework by default. This file meets Xcode requirements and supports running projects on iOS real devices and iOS simulators.
ZEGO recommends upgrading your SDK to version 2.8.0 or above. For detailed steps on integrating SDK, please refer to Quick Start - Integration.
Solution 2: Modify Build Options
This solution may become invalid in future Xcode versions and is not recommended.
In Xcode, select "TARGETS > Project Name > Build Settings > Build Options" menu and set "Validate Workspace" to "Yes".
