ld: building for iOS Simulator, but linking in object file built for iOS, file for architecture arm64

Hi! Running Xcode 12.5 using Rosetta 2 on simulator with iOS 14.5, and I get the following error: ld: building for iOS Simulator, but linking in object file built for iOS, file '.../Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/GoogleMaps' for architecture arm64

I've tried several things, including adding 'arm64' to Excluded Architectures for GoogleMaps and project targets, setting Build Active Architectures Only to Yes, setting Validate Workspace (under Build Options) to Yes, but nothing has worked for me.

The previous error I got before this one was "Undefined symbol: _OBJC_CLASS$_GULAppEnvironmentUtil". For that error, I followed https://github.com/firebase/firebase-ios-sdk/issues/8137 (add GoogleUtilities framework to Link Binary with Libraries) in hopes it would fix the problem, but it only gave me the GoogleMaps arm64 error.

I've been trying to fix this for a week now and am desperately running out of ideas, so any suggestions are appreciated. Thanks in advance!

Here is the Podfile, in case this is useful:

target 'WorkspaceName' do
 use_frameworks!

 pod 'SwiftGen'
 pod 'PromiseKit'
 pod 'Kingfisher'
 pod 'GoogleMaps'
 pod 'GooglePlaces'
 pod 'Firebase/Crashlytics'
 pod 'Firebase/Analytics'
 pod 'Firebase/Messaging'
 pod 'Branch'
 pod 'SwiftConfettiView'
end

Changing Excluded Architectures is not the right choice here. I explain why in another thread. Also, using Rosetta for Xcode is not supported. Xcode and the simulator support running natively on M1 Macs. Any need to use Rosetta points back to the same issue as the Excluded Architectures issue -- you need to talk to your third-party vendors and get updated library versions which support Apple silicon Macs.

@edford I have the same problem. However, the library I'm including is a legacy module that won't be updated by the 3rd party vendor. Lipo says:

Architectures in the fat file: LegacyLib are: i386 armv7 x86_64 arm64

As far as I can tell my only option seems to be to run Xcode in Rosetta mode or do you see any other option?

Xcode shipped as a Universal app that fully supports Apple silicon natively, so running Xcode under Rosetta is not supported. Your only option here is to update the library. If that's not possible with your current vendor, you'll need to find another library that is updated to be compatible with Apple silicon, or write your own code that handles the same functionality.

@edford: thx for the prompt response! Maybe I'm misunderstanding things, but I am indeed currently running Xcode using Rosetta. And the problem vanishes. As far as I thought I had understood it this is due to the Simulator also running in Rosetta - hence using the x86_64 arm64 lib and not giving me any problems when linking. Is there another explanation for this 'fix'?

ld: building for iOS Simulator, but linking in object file built for iOS, file for architecture arm64
 
 
Q