I’m building an app on an M1 Mac. I added a pod, Swift Package, or framework, attempted to use an object from it, and when I built my project, received this error. I’ve tried a number of things including changing build settings and deleting the derived data folder. The problem persists no matter what I try
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
This error seems to occur when a pod or framework isn't ready for the M1 processor yet. Resolving the error varies depending on if it's a pod or framework/Swift Package. Once you remove the offending package/framework/pod, it may be worth trying again if you really need it, sometimes the bug is intermittent.
Either Method (do this first!)
Sometimes this error is resolved without removing a pod or framework.
shift+cmd+k
Cocoapods
It seems to be necessary to deintegrate pods, remove the
Podfile.lock
, take the offending pod out of yourPodfile
, and reinstall pods.From Terminal:
nano
can be replaced with your text editor of choice. You just need to remove the offending PodFramework/Swift Package
Frameworks, Libraries, and Embedded Content
Delete
in the confirmation dialogueFinish Up
No matter the method you choose, it's a good idea to:
shift+cmd+k
I am using Firebase with Swift packages (and I have the m1), and this resolved the issue for me:
File -> Swift Packages -> Reset Package Caches
I did this after a hard restart and cleaning the build folder. All good now.