I am getting rid of my 8 year old mac, and am switching to the new m1 macbook air, but none of my old projects are running. I have installed cocoapods succesfully, but a lot of my big projects are running into errors, even after updating all the pods and running everything through Rosetta. Here are some of the errors I am running into in Xcode:
Could not find module ‘PodName’ for target
‘x86_64-apple-ios-simulator’; found: arm64, arm64-apple-ios-simulatorNo such module ‘PodName’
These are just a few, encountering many errors. I tried updating these pods, reinstalling them, etc. but nothing is working. Has anyone with a m1 mac had any success with this?
4
Answers
This seems likely related to this question & answer here: Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
Basically what you’ll need to do is make sure that:
ARCHS_STANDARD
)arm64
That should get you up and running.
One thing to note (that caught me up for a while): Make sure that you do not have the Build Setting of "Valid Architectures" (
VALID_ARCHS
). If you do, delete the line entirely. It was causing issues for me, because it was effectively ignoring the new paradigm that Apple wants us to use (Architectures + Excluded Architectures).Finally, if you do not see
VALID_ARCHS
but you’re still unable to run it, one thing that worked for me (since I also was coming back to an old project) was to:VALID_ARCHS
and set it to Standard architecturesYou can tweak your project architecture or add the following at the very end of your Podfile (and run
pod update
again) :This stumped me for ages.
You need to add the following line inside your pod file inside your project.
Add it for each build configuration. The full code to do this is:
There is also a chance that on an M1 machine you need to compile your pods using the x86_64 architecture. To do so running the following:
You can see the full solution on building for multiple architectures here.
Open your Build Settings and set
Excluded Architectures
value asarm64