Ionic - ld: 未找到框架 UserNotifications
Ionic - ld: framework not found UserNotifications
我创建了一个 ionic 项目并尝试使用 https://docs.ionic.io/services/push/
实现推送通知
ionic build ios
运行 没有任何问题。
但是当我尝试使用 ionic emulate iOS
在 IOS 上模拟应用程序时,它失败并出现以下错误。
ld: framework not found UserNotifications
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/emulator/JustBook\ Salon.app/JustBook\ Salon normal i386
(1 failure)
我对 运行 这些命令使用了管理员权限。
iOS 10引入新的UserNotifications framework。我假设此项目中使用的插件已更新为 support/include,这意味着您需要使用 XCode 8 进行构建,其中包括包含 UserNotifications 框架的 iOS 10 SDK。使用 XCode 7 构建将导致观察到的错误。
请注意,此时,Phonegap Build、Intel SDK 和 Ionic Cloud 等基于云的 Cordova 构建服务仍在使用 XCode 7.
我在 XCode 上也遇到过这个问题。
ld: framework not found UserNotifications
clang: error: linker command failed with exit code 1 (use -v to see invocation)
DaveAlden 解释了为什么会发生这种情况。
如何仍然使用 XCode 7
进行构建
浏览您的项目,找到 UserNotifications
,然后将其删除。
- 按命令 + Shift + F
- 查找匹配的文本
UserNotifications
。 .xcconfig
个文件应该出现在事件中。
- 在它出现的文件中,从每次出现的命令行参数中删除
-framework "UserNotifications"
。
- 保存
.xcconfig
文件。
- 构建并 运行.
到目前为止,我没有办法阻止 Pods 将这些行添加到项目中。
我创建了一个 ionic 项目并尝试使用 https://docs.ionic.io/services/push/
实现推送通知ionic build ios
运行 没有任何问题。
但是当我尝试使用 ionic emulate iOS
在 IOS 上模拟应用程序时,它失败并出现以下错误。
ld: framework not found UserNotifications
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/emulator/JustBook\ Salon.app/JustBook\ Salon normal i386
(1 failure)
我对 运行 这些命令使用了管理员权限。
iOS 10引入新的UserNotifications framework。我假设此项目中使用的插件已更新为 support/include,这意味着您需要使用 XCode 8 进行构建,其中包括包含 UserNotifications 框架的 iOS 10 SDK。使用 XCode 7 构建将导致观察到的错误。
请注意,此时,Phonegap Build、Intel SDK 和 Ionic Cloud 等基于云的 Cordova 构建服务仍在使用 XCode 7.
我在 XCode 上也遇到过这个问题。
ld: framework not found UserNotifications
clang: error: linker command failed with exit code 1 (use -v to see invocation)
DaveAlden 解释了为什么会发生这种情况。
如何仍然使用 XCode 7
进行构建浏览您的项目,找到 UserNotifications
,然后将其删除。
- 按命令 + Shift + F
- 查找匹配的文本
UserNotifications
。.xcconfig
个文件应该出现在事件中。 - 在它出现的文件中,从每次出现的命令行参数中删除
-framework "UserNotifications"
。 - 保存
.xcconfig
文件。 - 构建并 运行.
到目前为止,我没有办法阻止 Pods 将这些行添加到项目中。