Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12 simulator crash

I'm getting weird crash in Xcode 12 simulator with signal SIGABRT right after launch. it is happening on released version of Xcode 12.0 and Xcode 12.0.1 I have tried with newest beta 12.2.

App is working fine on device.

I can not trace much due to less log. following is stack.

Thread 1

dyld`__abort_with_payload:
0x1194b0ed4 <+0>:  movl   $0x2000209, %eax          ; imm = 0x2000209 
0x1194b0ed9 <+5>:  movq   %rcx, %r10
0x1194b0edc <+8>:  syscall 
->  0x1194b0ede <+10>: jae    0x1194b0ee8               ; <+20>
0x1194b0ee0 <+12>: movq   %rax, %rdi
0x1194b0ee3 <+15>: jmp    0x1194af408               ; cerror_nocancel
0x1194b0ee8 <+20>: retq   
0x1194b0ee9 <+21>: nop    
0x1194b0eea <+22>: nop    
0x1194b0eeb <+23>: nop    

enter image description here

enter image description here

EDIT After Adding exception break point, getting following console output

dyld: Library not loaded: /usr/lib/libnfshared.dylib
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreNFC.framework/CoreNFC
Reason: no suitable image found.  Did find:
/usr/lib/libnfshared.dylib: mach-o, but not built for platform iOS-sim

In my project i'm not using CoreNFC. it is not linked and not being used by pods, this i've already checked

like image 616
Arslan Asim Avatar asked Sep 28 '20 10:09

Arslan Asim


2 Answers

My solution: Manually copied libnfshared.dylib from Xcode 12 beta 6 to: Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

This works for me. 💯

If you want to avoid the hassle of downloading 11.25GB Xcode 12.2 beta for a single file. I have the file to share.

You may execute the following command to download and place it inside the Xcode package:

sudo curl https://storage.googleapis.com/mobile-simulator-build/libnfshared.dylib -o /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnfshared.dylib

Hope it helps 😉

like image 111
Arif Fikri Abas Avatar answered Oct 18 '22 00:10

Arif Fikri Abas


I had the same issue where the simulator for iOS14 would crash right after launch. The older iOS simulators and deploying to a device with iOS14 worked fine.

My solution: Manually copied libnfshared.dylib from Xcode 12 beta 6 to:

Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

as it appears this file is missing in release version.

like image 1
Napp Avatar answered Oct 18 '22 00:10

Napp