Xcode12 iOS14模拟器 NFC崩溃[解决方法]

今天爱分享给大家带来Xcode12 iOS14模拟器 NFC崩溃[解决方法],希望能够帮助到各位。

崩溃现象
在升级到Xcode12之后,启动项目就崩溃,报错信息如下
Xcode12 iOS14模拟器 NFC崩溃[解决方法]插图

在Console里打印了具体日志,发现是项目中用到了NFC模块,但是dyld并未加载NFC模块引起的。日志如下:

dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/***/Library/Developer/CoreSimulator/Caches/dyld/19G73/com.apple.CoreSimulator.SimRuntime.iOS-14-0.18A372
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/***/Library/Developer/Xcode/DerivedData/BeeSafe-awnlestrbvesqqbynrhmluzhbcsc/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSi
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

出现这个问题可能是因为xocde12没有附带nfc的这个功能。

解决方法
终端手动安装一下libnfshared.dylib,如果没有速度,需要开科学上网

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

安装完成之后,重启xcode和模拟器即可解决

人已赞赏
IOS

[iOS14] YYWebImage YYAnimatedImageView 网络图片不显示[解决方案]

2020-10-17 18:05:05

IOS

升级iOS14 app遇到的问题总结

2020-10-18 18:12:52

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧