skip to Main Content

I’m using the Firebase and the SDWebImageSwiftUI module in my SwiftUI 2 app with Xcode 12.3 and Cocoapod 1.10.0 on my Apple M1 MacBook Pro.

As long as I don’t integrate the Firebase Analytics module via Cocoapod the app works fine but when I integrate it, I get the same error as the guy here: Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64. His solution also works for me (exclude arm64 architecture for the project and pods).

However now the SDWebImageSwiftUI module (included via swift package manager) is complaining "Could not find module ‘SDWebImageSwiftUI’ for target ‘x86_64-apple-ios-simulator’; found: arm64, arm64-apple-ios-simulator". If I include the module via Cocoapod then the compiler says "No such module "SDWebImageSwiftUI".

Does anyone of you has an idea on what I could do?

Any help is much appreciated

5

Answers


  1. Edit March 2023 – Since Firebase 7.5.0, Firebase supports the M1 processor by default. No special instructions are needed.

    When specifying which version of Firebase you’d like in your Podfile, append -M1 to the version. See the following examples:

    Explicitly require the special M1 tagged Firebase version, locked to the exact version. Note
    that due to the version scheme, you’re required to update this manually for each release otherwise
    you will revert to the official release (ex. 7.2.0 instead of 7.2.0-M1).

    pod ‘Firebase/Analytics’, ‘7.2-M1’

    Do the same for any other Firebase pod used.

    pod ‘Firebase/Database’, ‘7.2-M1’

    Remember: now you need to manually add -ObjC to avoid a runtime crash. This CocoaPods issue has been fixed in CocoaPods/CocoaPods#10234 and is merged for the upcoming CocoaPods 1.10.1 patch release.

    Login or Signup to reply.
  2. Checking the option "Open with Rosetta" (as in the screenshot below) helped me to solve this problem. After the error disappears, you can switch back and open Xcode without Rosetta.

    Property dialog for Xcode with "Open with Rosetta" checked

    Login or Signup to reply.
  3. You no longer need to append M1 according to the updates from Firebase. You may check it on the link for further instructions.

    Starting with Firebase 7.5.0, Firebase supports Apple Silicon Macs via CocoaPods. CocoaPods 1.10.0 is required.

    The special M1 versions required for FirebaseAnalytics support for versions 7.2.0 through 7.4.0 are no longer necessary.

    https://github.com/firebase/firebase-ios-sdk/blob/master/AppleSilicon.md

    Login or Signup to reply.
  4. Try this:
    In your root
    sudo arch -x86_64 gem install ffi
    cd to your project folder and
    arch -x86_64 pod install

    Login or Signup to reply.
  5. Please take a look at this. https://stackoverflow.com/a/68037246/4862289

    Go to Application folder -> Right click on Terminal App -> Get Info

    Tick Open with Rosetta option.

    try pod install now.

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