且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Xcode 10,带有CoreNFC的Swift 4应用在iOS 12上发生崩溃

更新时间:2022-10-26 19:14:30

转到 项目设置->常规->链接的框架和库

添加状态为可选的CoreNFC.framework

My app created for iOS submitted to Appstoreconnect gets rejected as it crashes on launch in their review process.

My app uses CoreNFC framework. So this app is compatible with devices iPhone 7, 8, X.. with iOS 11 or higher. App was tested by me on physical device, working fine. Also launching on simulators was fine (NFC functions not working, but app didn't crash).

Crashlog contains info where I can see that CoreNFC framework was not loaded on their launch:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Description: DYLD, Library not loaded: /System/Library/Frameworks/CoreNFC.framework/CoreNFC | Referenced from: /var/containers/Bundle/Application/223F146A-DF69-43CC-89A1-CFDF323ACB45/SharpEnd NFC Scanner.app/SharpEnd NFC Scanner | Reason: image not found

I tried to embed CoreNFC framework in app General tab -- Embedded Binaries, but it gives me build errors so I'm not sure it is possible.

So my questions are:

  • Is it possible to embed CoreNFC framework in Embedded Binaries section in Xcode?
  • Is it possible to check whether device supports this framework before loading it?

Any help or workaround would be much appreciated..

Go to Project settings -> General -> Linked Frameworks and Libraries

Add CoreNFC.framework with status optional