Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10, Swift 4 app with CoreNFC crashes in review on iOS 12

Tags:

xcode

ios

swift

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..

like image 541
deevee Avatar asked Sep 28 '18 21:09

deevee


3 Answers

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

Add CoreNFC.framework with status optional

like image 63
Nikhil Patel Avatar answered Nov 15 '22 12:11

Nikhil Patel


I had the same problem with my NFC Reader. It looks like iOS12 does not include CoreNFC for older devices (iPhone 6s, SE and older).

I managed to fix it with device checks. In case an old device is trying to open the app I show a completely different storyboard with an error message that the device is not supported.

To see an example, here is a link to the app: https://itunes.apple.com/us/app/nfc-reader-for-iphone/id1249686798

like image 4
Nico S. Avatar answered Nov 15 '22 12:11

Nico S.


In my case, we couldn't restrict to only devices with NFC because we uploaded the original build of the app without that requirement and Apple does not allow you to add new restrictions for new versions of apps that didn't exist in previous versions.

Uploading a new build with the CoreNFC.framework under Project settings -> General -> Linked Frameworks and Libraries while I type this up and will update this comment as soon as we know whether or not it worked.

edit it worked. :)

like image 1
James Tice Avatar answered Nov 15 '22 14:11

James Tice