关于这个问题有几篇文章,但没有一个建议的解决方案适用于我的情况。我正在尝试按照 Apple 提供的说明将 WatchKit 集成到一个简单的示例应用程序中(我现在已经尝试了几个)。编译时出现以下错误消息:
"error: WatchKit Extension doesn't contain any WatchKit apps. Verify that the value of WKWatchKitApp in your WatchKit App's Info.plist is set to YES."
我已成功编译并运行 Apple Watch“Catalog”示例,因此我知道从 iPhone 到 Watch 的角度来看一切正常。当我尝试与现有应用程序集成时,似乎有些地方不对劲。 我在这里看过关于这个主题的帖子(例如 WatchKit app wont run on simulator ),但在我的情况下没有任何修复工作;包 ID 似乎都是正确的。请注意,我正在尝试在 iPhone 6 而不是模拟器上编译和运行。 有什么建议吗?
最佳答案
当我更改我的主要 iOS 应用程序的 bundle id 时,我发生了这个错误。 这是我在项目浏览器中所做的
在 WatchApp 下 --> plist
WKCompanionAppBundleIdentifier ==> 给出 iOS 应用的 id (com.xxxx.appname)
在 WatchApp 扩展下 --> plist
NSExtension-->NSExtensionAttributes-->WKAppBundleIdentifier ==> 给出你的 watchkit 应用的 id(例如:com.xxxx.appname.watchkitapp)
这为我修复了错误。
关于ios - WatchKit App 无法编译 : "error: WatchKit Extension doesn' t contain any WatchKit apps",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32063038/