0

I have inherited an old project with some old CocoaPods dependencies that do no support arm64 devices. So when I go to import the module (whether it be pods or using Swift Package Manager) ... i.e.

import Module

I get the error:

(Compile swift source files (arm64), No such module 'Module' found)

I know that there are past questions and answers for building/testing on a simulator and changing the build settings/valid archs/excluded archs) but I am actually trying to get to this to work on a device that has 64-bit architecture. The machine that I am working on is still Intel (not M1).

If the CocoaPods library or Swift package doesn't include support for 64-bit, what workarounds are there (if any)?

It also looks like on Xcode 14.2 (macOS Monterey 12.6.3) that the option of opening Xcode using Rosetta is no where to be found. Excluding certain archs in build settings and all other past solutions appear to not work.

Anyone have any suggestions?

HangarRash
  • 7,314
  • 5
  • 5
  • 32
cspam
  • 2,911
  • 2
  • 23
  • 41
  • If your dependency is strictly i386, then your only option is to use an old Xcode on an old version of macOS and target macOS 10.14 and below. macOS 10.15 removed support for 32-bit binaries. But if you can target x86_64, then just... do that? Also I don't understand why you want to run Xcode in Rosetta if you're on an Intel machine. Your CPU is already x86_64, you can't possibly be running the arm64 slice of Xcode. – Siguza Feb 15 '23 at 17:45
  • if i target x86_64, then how do i then run the app on a device that is arm64? i.e. i cannot change the code and launch the app on my iPad 7th gen/9th gen. – cspam Feb 15 '23 at 19:35
  • Oh, I missed the `[ios]` tag, I thought you were targeting macOS. But alright, if your dependency only supports armv7 and not arm64, then you need to find a replacement that does. iOS 10 was the last version to support 32bit, and the A11 chips and later don't even support A32 in hardware. – Siguza Feb 15 '23 at 20:55
  • ok @Siguza. i went back and looked at each individual pod targets architecture and they all have "Standard Architectures (arm64) - $(ARCHS_STANDARD) so it looks like they are all good to go. Any other reason for me to get the arm64 errors? under Build Active Arch Only: Debug (Yes), Release (No) – cspam Feb 16 '23 at 03:29

1 Answers1

0

Xcode building for iOS Simulator, but linking in an object file built for iOS, for architecture 'arm64'

PROJECT Pods - Build Settings - Excluded Architectures add Any iOS Simulator SDK: arm64

kenzhao
  • 1
  • 1