Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12 issue - Could not find module 'FrameworkName' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64

Tags:

ios

swift

xcode12

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?

like image 256
Stefo Avatar asked Sep 23 '20 10:09

Stefo


People also ask

Does x86_64-apple-iOS-simulator work with 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'?

'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

How to build custom framework for iOS simulator?

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.

How to make Xcode only build on one architecture?

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.


5 Answers

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:

  • Before I had: VALID_ARCHS = arm64, arm64e
  • After fixing: 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:)

like image 66
Mete Avatar answered Oct 23 '22 10:10

Mete


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.

enter image description here

like image 25
Rufat Mirza Avatar answered Oct 23 '22 12:10

Rufat Mirza


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.

enter image description here

enter image description here

like image 2
Sajjad Hajavi Avatar answered Oct 23 '22 10:10

Sajjad Hajavi


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

like image 2
Purnachandar Rao Voleti Avatar answered Oct 23 '22 10:10

Purnachandar Rao Voleti


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.

enter image description here

like image 1
Nikaaner Avatar answered Oct 23 '22 10:10

Nikaaner