Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods won't work on new m1 mac Big Sur Xcode

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?

like image 644
Kazim Walji Avatar asked Dec 31 '22 18:12

Kazim Walji


1 Answers

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
like image 83
lchamp Avatar answered Jan 18 '23 16:01

lchamp