#IBDesignable preview in IB again broken under XCode 14.2 on M2? - xcode

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?

the formatting now is not ok. The error message ends with
.../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'))

Related

dlopen failed for DYLIB - Slice is not page aligned

With binaries built using XCode 13.1 and executing on Monterey 12.0.1
When i load a dylib I get following error:
dlopen failed for DYLIB: (/Library/Application Support/Test/cor.dylib) Error:(dlopen(/Library/Application Support/Test/cor.dylib, 0x0006): tried: '/Library/Application Support/Test/cor.dylib' (slice is not page aligned, fat file, but missing compatible architecture (have 'x86_64,arm64', need 'x86_64h'))).
This is seen when I sign the binary. Same binary which is unsgined works properly.
Both the loader binary and the dylib are built using Standard Architecture (universal). So i am clueleses what might be the error.

Xcode 14 - Warning Running UI Tests on M1 (Specified architecture not Compatible)

I am facing the below warning in Xcode console. Any ideas?
Warning: Error creating LLDB target at path
'/Users/abhishek.bedi/Library/Developer/Xcode/DerivedData/
<MyProject>-hbkaixyoplhkzbdfcgkfxrqdklqt/Build/Products/
QA-iphonesimulator/MyUITests-Runner.app'- using an
empty LLDB target which can cause slow memory reads from
remote devices: the specified architecture
'arm64-*-*' is not compatible with 'x86_64-apple-ios11.0.0-simulator'

XCode - Library cannot be inserted libclang_rt.asan_ios_dynamic.dylib

After updating to Xcode 11.4 suddenly the following error is being thrown from the debugger when my application begins running on a physical iPhone connected to Xcode.
dyld: warning: could not load inserted library '#executable_path/Frameworks/libclang_rt.asan_ios_dynamic.dylib' into hardened process because no suitable image found. Did find:
/private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib: code signature invalid for '/private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib'
/private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib: code signature invalid for '/private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib'
/private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib: stat() failed with errno=1
dyld: Library not loaded: #rpath/libclang_rt.asan_ios_dynamic.dylib
Referenced from: /private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/HeadPop!
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib: code signature invalid for '/private/var/containers/Bundle/Application/40EE2455-9E2E-4259-A997-F439F67E9CE5/sample-app!.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib'
Can anyone please explain to me what this library libclang_rt.asan_ios_dynamic.dylib is ?
And how to recover from this issue?
In my case the exception (in Xcode 11.4) was:
dyld: could not load inserted library '.../Build/Products/Debug-iphonesimulator/MyApp.app/PlugIns/UnitTests.xctest/Frameworks/libclang_rt.asan_iossim_dynamic.dylib' because image not found
And the clue in a comment above is right: the issue was caused by thread_sanitizer: true in fastlane configuration for 13.4.1 device. Same flag for 12.4 device did not cause any problem.
I didn't find a better solution than removing this flag.
I also had this issue with the "Undefined Behavior Sanitizer" checked. Seems like this may occur with any sanitizer. Unchecking resolved the issue.
Find the Sanitizer checkboxes in Product > Scheme > Edit Scheme > Run > Diagnostics

ld and clang error in RInside for Mac OSX

I want to try out RInside for Mac OSX. I downloaded RInside from source using Terminal and then went into the /inst/examples/standard and tried to run make, as indicated in the answer to this thread: RInside on Mac OS X
However, the first error I received was fatal error: 'RInside.h' file not found. I manually found this file and put it into the /inst/examples/standard directory and ran make again. I received another fatal error for another .h file so I manually found the requisite file and inserted it into this standard directory. Anyway, after doing that a few more times, all dependencies were taken care of, then I ran make again and received the following very strange error:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also tried using clang++ -stdlib=libstdc++ in place of g++ (since RInside on Mac OS X says that g++ won't work), but it did not help either (i.e., I received the same architecture errors).
I am stuck here...
UPDATE:
As per Dirk Eddelbuettel's advice, I tried installing XTools (Run Windows X System on OSX), but I received the following error: "Xtools.pkg" is damaged and can't be opened. You should eject the disk image."
I am concerned that running a simple "hello world" script as provided on the RInside webpage (http://dirk.eddelbuettel.com/code/rinside.html) can be this convoluted on the Mac as to demand external installs and miscellaneous configurations. Hence, there must be a more straightforward way to run RInside on the Mac OS X.

Duplicate Symbole in xCode, But no duplicate exist

The Problem
Xcode (Version 4.6.1 (4H512)) is complaining a duplicate symbole problem.
duplicate symbol _OBJC_METACLASS_$_PacksStoreHelper in:
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreViewController.o
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreHelper.o
duplicate symbol _OBJC_CLASS_$_PacksStoreHelper in:
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreViewController.o
/Users/shannoga/Library/Developer/Xcode/DerivedData/English_Club-cyrjamihpabtvtdkvctjwyidupuo/Build/Intermediates/English Club.build/Debug-iphonesimulator/English Club.build/Objects-normal/i386/PacksStoreHelper.o
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Usually I go to the Target Build Pases -> Compile Sources and look for the duplicate.
This time as you can see there is no duplication there:
What I tried and some wacky stuff :
Deleting Derived Data.
Removing the project and restarted the mac.
I even tried to delete the so called "duplicate" files and here it got even more wacky - The target successfully builded and there was no warning even that the files were not visible in the file navigator. After the build the app works fine but one of the controllers is not visible.
I Alt+Clicked the import statements of the duplicate files in other files that uses them and it gets me onto a "Zombie" file with all the code inside. But I can not see where xCode get the file from.
What the hell could it be?
I am about to shoot myself. Please save me.

Resources