ios - XCode 11.3、装有 iOS 13.2.2 的模拟器 iPhone X 和装有 watchOS 4.2 的 Apple Watch 42mm 时崩溃

标签 ios swift iphone xcode apple-watch

Apple Watch 1 崩溃

dyld: lazy symbol binding failed: Symbol not found: _WKExtensionMain
 Referenced from: /Users/User/Library/Developer/CoreSimulator/Devices/8C1ABCBE-4C0B-47BE-8169-0278C2BE766B/data/Containers/Bundle/Application/B0118FCC-A517-4339-8166-65A7D0D33217/Watch.app/PlugIns/Watch Extension.appex/Watch Extension
 Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 4.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WatchKit.framework/WatchKit

dyld: Symbol not found: _WKExtensionMain
 Referenced from: /Users/User/Library/Developer/CoreSimulator/Devices/8C1ABCBE-4C0B-47BE-8169-0278C2BE766B/data/Containers/Bundle/Application/B0118FCC-A517-4339-8166-65A7D0D33217/Watch.app/PlugIns/Watch Extension.appex/Watch Extension
 Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 4.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WatchKit.framework/WatchKit

适用于 Apple Watch 2、3、4、5 的相同代码可以正常工作

谢谢你的帮助

最佳答案

Xcode 11 的发行说明说:

The WatchKit framework is no longer included in the iOS SDK. If you’re using WatchKit APIs from iOS, you need to remove this use. The WatchKit framework remains available on watchOS. If you’re using WatchKit APIs from iOS to infer availability of features on the paired Apple Watch, include information about your use case when you submit feedback to Feedback Assistant. (49707950)

https://developer.apple.com/documentation/xcode-release-notes/xcode-11-release-notes

您可以将build设置更改为旧版,以便现在可以使用。

PS:旧版设置在 Xcode 12b2 中已弃用

https://developer.apple.com/documentation/xcode-release-notes/xcode-12-beta-release-notes

我建议您不要使用旧版build设置。您缺少新构建系统的许多功能,并且在即将推出的 Xcode 版本中也已弃用

关于ios - XCode 11.3、装有 iOS 13.2.2 的模拟器 iPhone X 和装有 watchOS 4.2 的 Apple Watch 42mm 时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62812637/

相关文章:

javascript - 将 JavaScript 函数注入(inject) UIWebView 并不总是有效

iphone - 在哪里使用 CFBundleName

ios - 如何在Scenekit场景编辑器中设置漫反射贴图

ios - 带有搜索栏的 UITableView 作为 inputView

objective-c - 无法将 Float 类型的值转换为预期的参数类型 NSNumber

objective-c - Objective-C 工厂方法如何转换为 Swift 便捷初始化器?

swift - 遍历对象的属性(在 Realm 中,也可能不在)

iphone - 如何从 NSDictionary 获取键的对象?

ios - 更改导航栏高度

ios - NSError 版本 : message sent to deallocated instance