After updating to Xcode 12 the project gives me this error when building on simulator:
Could not find module 'FrameworkName' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64
The framework is installed with cocoapods. It works with Xcode 11. Building on "Any iOS Device" or real iPhone with Xcode 12 also works just fine. What's different in Xcode 12?
Could not find module 'FrameworkName' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64 The framework is installed with cocoapods. It works with Xcode 11. Building on "Any iOS Device" or real iPhone with Xcode 12 also works just fine. What's different in Xcode 12?
'Could not find module 'PODNAME' for target 'x86_64-apple-ios-simulator';' where PODNAME is the pod throwing the error when you compile. Delete your pods and install pods with this command "arch -x86_64" pod install
1) Build YourCustomFramework target for iOS simulator and extract framework from products folder on your desktop. Xcode ▸ DerivedData ▸ Your Project ▸ Build ▸ Products ▸ Release-iphonesimulator 2) Build YourCustomFramework target for Generic iOS Device and extract framework from products folder on your desktop.
And then you should open XCode > -Your Main Target- > Build Active Architecture Only and set 'NO' to build on the all architectures. YES - If set to yes, then Xcode will detect the device that is connected, and determine the architecture, and build on just that architecture alone. NO - If set to no, then it will build on all the architectures.
I fixed this by ensuring the build setting VALID_ARCHS
(now appearing at the bottom of Build Settings in Xcode 12) contains "x86_64
".
That is:
VALID_ARCHS = arm64, arm64e
VALID_ARCHS = arm64, arm64e, x86_64
(A little counterintuitive, as the error message says it couldn't find the module for arm64
-apple-ios-simulator, :shrug:)
This situation presumably arises when you modify your project to suit the new M1 Macs, and then try to run the same project on an Intel Mac.
It basically tries to run on the ARM architecture and finds X86_64 instead.
To resolve the problem you just need to restrict the build operation to the active (X86_64) architecture only.
You can do this by setting Build Active Architectures only to YES.
I solved this by excluding arm64 in both app Target and test Target for Debug like the below pictures.
Tested and worked on Xcode 13.
Got this error on our app for library and this solved my problem:
close XCode
open Finder app and show there "Applications"
right click on icon Xcode and click on "Get info" (or something similar)
there is checkbox "Open with Rosseta" (or something similar). Select it
run Xcode again and try to build
https://developer.apple.com/forums/thread/123614?login=true
You can try to set $(ARCHS_STANDARD)
for VALID_ARCHS
for Debug for Any iOS Simulator SDK and set YES
for ONLY_ACTIVE_ARCH
for Debug. It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With