skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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.

    1. Clear your Derived Data folder
    2. Clean the build folder with shift+cmd+k

    Cocoapods

    It seems to be necessary to deintegrate pods, remove the Podfile.lock, take the offending pod out of your Podfile, and reinstall pods.

    From Terminal:

    pod deintegrate
    rm Podfile.lock
    nano Podfile
    

    nano can be replaced with your text editor of choice. You just need to remove the offending Pod

    pod install
    

    Framework/Swift Package

    1. Click on your project file in Xcode (the blue icon)
    2. With the target selected that contains the framework, click on General
    3. Scroll down to Frameworks, Libraries, and Embedded Content
    4. Click on the offending Framework
    5. Click on the minus icon at the bottom of the list
    6. Click Delete in the confirmation dialogue

    Finish Up

    No matter the method you choose, it's a good idea to:

    1. Clear your Derived Data folder
    2. Clean the build folder with shift+cmd+k
    3. Reach out to the framework/pod author and ask them to update it for M1 support
    4. File a bug report with Apple

  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search