Patrick Bodet Patrick Bodet - 21 days ago 18
iOS Question

iOS 10 UNUserNotificationCenter link error

I have an Xcode project, Xcode 8.1 (8B62) with two targets, one for the paid version of the application and the other for the free version. They both manage remotes push notifications. Since I made the changes for iOS 10 with the new framework UNUserNotificationCenter.framwork, everything is fine for the first target and I have a link error for the second. It worked well under iOS 9 with the old methods. What I did for both targets:


  • Capabilities: Enabled Push Notifications (Entitlements are properly updated)

  • In AppDelegate.h: #import

  • In AppDelegate.m: Updated the code with the new methods



It's the same code for both targets.

Unfortunately, for the second target, I have the following error:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS _ $ _ UNUserNotificationCenter", referenced from:
      Objc-class-ref in AppDelegate.o
Ld: symbol (s) not found for architecture
Clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have done several times clean and clean build target folder, re-start Xcode, re-start the computer but nothing is done.

Nothing found in the different forums ...

Help would be welcome. Thank you in advance.

Answer

Make sure UserNotifications.framework exists in your Target > General > Linked Frameworks and Libraries