Reputation: 71
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-simulator
No 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?
Upvotes: 7
Views: 10813
Reputation: 113
Open your Build Settings and set Excluded Architectures
value as arm64
Upvotes: 1
Reputation: 69
This stumped me for ages.
You need to add the following line inside your pod file inside your project.
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
Add it for each build configuration. The full code to do this is:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
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:
arch -x86_64 pod install
You can see the full solution on building for multiple architectures here.
Upvotes: 2
Reputation: 6612
You can tweak your project architecture or add the following at the very end of your Podfile (and run pod update
again) :
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
Upvotes: 10
Reputation: 1828
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 architecturesUpvotes: 6