Switching to Xcode 10 causes `UserNotifications.framekwor dyld: Library not loaded crash` for iOS9

…衆ロ難τιáo~ 提交于 2019-12-20 06:04:12

问题


We have an app that is working properly with the UserNotification.framework being linked as required framework in Xcode 9. Everything works smooth here.

Now we are switching to Xcode 10. But there linking this framework as required leads to

dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserNotifications
  Referenced from: /var/containers/Bundle/Application/1D41BD68-9B88-4D5D-B7AB-0D1C31979964/App.app/App
  Reason: image not found

If I switch it to optional push notification (via Intercom) won't work anymore.

What is the reason? How can we fix that? Why is it even working in Xcode 9?

Update #1

using

@import UserNotification

does not fix it

Update #2

Its fixed by importing and using it actually (in AppDelegate.m) like this

UNNotificationRequest* unr = [UNNotificationRequest alloc];
unr = nil;

Why?

It is related to the same issue I have experienced already.

CABTMidiCentralViewController used in Storyboard only working if using code reference

Update #3

More generic question

Xcode sometimes removes linked library


回答1:


UserNotification SDK is available on iOS 10+, Try to update the deployment Target to iOS 10 +




回答2:


Can your please try removing the framework and adding that again ? I just created a new project this framework added in Xcode 10 and was able to run in the device without any errors.



来源:https://stackoverflow.com/questions/54344463/switching-to-xcode-10-causes-usernotifications-framekwor-dyld-library-not-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!