Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Xcode 12.2 building for wrong architecture?

On my MacBook Pro (Retina, 15-inch, Mid 2014 — 2.5 GHz Quad-Core Intel Core i7), running macOS Catalina 10.15.7 (19H15):


Today I allowed my App Store to upgrade my laptop to Xcode 12.2, it was previously on Xcode 12.1.


When I tried to recompile I got many load errors like this:


ld: warning: ignoring file /usr/local/Cellar/opencv/4.5.0_5/lib/libopencv_gapi.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64


How do I get Xcode to build for the machine it is running on, like it did before today?

MacBook Pro 15″, macOS 10.15

Posted on Dec 1, 2020 3:16 PM

Reply
Question marked as Best reply

Posted on Dec 6, 2020 12:25 PM

Aha-ha!!


The key to this (unsurprisingly in retrospect) is the project setting Build Active Architecture Only., which has separate settings for Debug and Release.


Perhaps it is new, or the default changed, or the interpretation of the default changed? But this fix (which I assume should be regarded as temporary) got me going again, building in Release mode without error:


  • go to Project Settings
  • select the executable
  • select Build Settings tab
  • search for “Architectures”
  • change Build Active Architecture Only to be Yes for both Debug and Release


Similar questions

2 replies
Question marked as Best reply

Dec 6, 2020 12:25 PM in response to cwr

Aha-ha!!


The key to this (unsurprisingly in retrospect) is the project setting Build Active Architecture Only., which has separate settings for Debug and Release.


Perhaps it is new, or the default changed, or the interpretation of the default changed? But this fix (which I assume should be regarded as temporary) got me going again, building in Release mode without error:


  • go to Project Settings
  • select the executable
  • select Build Settings tab
  • search for “Architectures”
  • change Build Active Architecture Only to be Yes for both Debug and Release


Dec 2, 2020 9:42 AM in response to cwr

Aha!

I tried to “confirm” the same problem existed for a companion project and it compiled / ran fine. The difference was the Debug/Release setting in the current Scheme. When I set the original project to use Debug build, it compiles fine and runs, albeit more slowly.


FYI: I filed a report about this in Feedback Assistant: (FB8925173)

Xcode 12.2 building for wrong architecture?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.