. Advertisement .
..3..
. Advertisement .
..4..
XCode is an integrated software development suite developed by Apple that runs on the Mac operating system for developers who can develop software that runs on the Mac and iOS operating systems. Many of you, like us, may continue to encounter numerous errors while using the app. One of the most frequently asked errors, for example, is “Building for iOS Simulator, but the linked and embedded framework was built for iOS + iOS Simulator“. So, how can this be resolved? We will discuss together to figure out the best solutions for you.
When Does The Error “Building for iOS Simulator, but the linked and embedded framework was built for iOS + iOS Simulator” Happen?
The following error may occur while updating the Xcode 12.2 to Xcode 12.3 version.
Building for iOS Simulator, but the linked and embedded framework 'My.framework' was built for iOS + iOS Simulator
Beginning with Xcode 11.4 is when the problem is noticed. Since this version, Xcode verifies that all embedded frameworks are created for the appropriate platform before beginning a build. In our instance, when applied to a stale framework produced during the prior build for an iOS simulator, this check fails after switching to an iOS device. The packForXcode Gradle task often replaces this outdated framework with a suitable one. The build process, however, halts before beginning this operation because Xcode runs the framework platform check before performing build steps.
Simple Solutions For The Error: Building for iOS Simulator, but the linked and embedded framework was built for iOS + iOS Simulator
And, believe it or not, you might be able to solve it with simple methods.
Solution 1: Exclude simulator architecture while building for the device
We must exclude device architecture while building for simulators, and you must exclude simulator architecture while building for the device.
Now you need to follow these steps.
- Navigate to your project’s Build Settings.
- Architectures Excluded.
- Choose a configuration (Debug/Release/etc…).
- Tap +.
- Include arm64, arm64e, and armv7.
This may resolve your error.
Solution 2: Rebuild the framework as an XCFramework
This framework was not designed with a supported configuration in mind — iOS Simulator and iOS code have never been supported in the same binary.
In Xcode 11, the linker began detecting these incorrect configurations and issuing warnings, and Xcode 12 goes even further in detecting these issues.
The only proper solution is to rebuild the framework as an XCFramework. Follow the instructions in the video and the Xcode Help article if this is your framework or one owned by another group in your company.
If you purchased this framework from a vendor, you must work with the vendor to obtain the updated version of the framework built with a supported configuration.
A build script in this thread’s discussion attempts to resolve this error. Scripts like that, or anything that attempts to manipulate the output with commands like lipo, still result in an unsupported configuration in the binary. The XCFrameworks framework is the way to go.
Solution 3: Only clean modules that are included in the Xcode project
Excepting two solutions mentioned above, there is another way for you to resolve the error ”Building for iOS Simulator, but the linked and embedded framework was built for iOS + iOS Simulator”.
After switching between simulator and device, let’s run ./gradlew clean for the Kotlin module included in the Xcode project. Keep in mind that do not clean full of the Kotlin modules, only clean modules that are included in the Xcode project.
After doing that, your error will be completely resolved and your program will run well without any errors.
Conclusion
XCode helps programmers develop common types of iOS applications such as games and tab-based applications that users will move through screens using tabs. If you’re stuck on the error “Building for iOS Simulator, but the linked and embedded framework was built for iOS + iOS Simulator“, the remedies listed above are the fastest way. People have a growing community where everybody is usually willing to help if you still need advice or have frequent Xcode doubts. Finally, we hope you’re having fun with the amazing code options and appreciate spending time reading.
Read more
Leave a comment