0

I receive the error:

.../Base.lproj/MainMenu.xib Failed to render instance of : dlopen(....app, 0x0001): tried: '/...' (no such file), '....app' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS....app' (no such file), '....app' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))` when loading my .xib. Where <MyView> stands for the name of my derivated NSView and the ... for my application name.

There are quite a number of reports with this or a similar issues when the 1st M1 processors were on the market as: (Xcode 12 Apple M1 arm64 - Designable error: "wrong architecture") or (IBDesignable Build Failed) and more. Most of them add some pathes to the LD_RUNPATH_SEARCH_PATHS under "Linking".

None of the solutions given there were helpful for me, but I found a link where you could change the arch under which the Terminal should run. see

Partly solved: Now after opening my .proj file and when I receive this error, I open the Terminal.app, switch it to Intel and then back to Arm (leaving the terminal window open) and voila the IB preview displays correctly. See result here

Concerning XCode this is a regression, since under Intel Xcode 11 this always was working correctly.

Anybody knows, what is happening or how to avoid this inconvenience?

Eilon
  • 2,698
  • 3
  • 16
  • 32

1 Answers1

0

In the meantime I found that the last part of the message with

mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')

is the important part of the error message.

It really seams to be a regression of XCode 14.3. My previously written workaround is not working anymore with the latest OS update, but a solution working for me was given by Robert Fogash in the

Xcode 12 Apple M1 arm64 - Designable error: "wrong architecture"

thread. It is not sufficient to set the Build Active Architecture Only flag, but you should also set the debug architecture explicitly!

This now is my working build setting. Please pay attention that still you need to stop and re-start XCode to be effective.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459