WatchKit 应用程序无法编译:“错误:WatchKit 扩展不包含任何 WatchKit 应用程序"; [英] WatchKit App won't compile: "error: WatchKit Extension doesn't contain any WatchKit apps"
问题描述
有几个关于这个问题的帖子,但没有一个建议的解决方案适用于我的情况.我正在尝试按照 Apple 提供的说明将 WatchKit 集成到一个简单的示例应用程序中(我现在已经尝试了几个).当我编译时,我收到以下错误消息:
There are several posts on this issue but none of the proposed solutions work in my case. I am trying to integrate the WatchKit into a simple, sample app (I've tried a couple now) by following the instructions provided by Apple. When I compile I get the following error message:
"错误:WatchKit 扩展不包含任何 WatchKit 应用程序.验证WKWatchKitApp 在 WatchKit App 的 Info.plist 中的值是设置为是."
"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目录"示例,所以我知道从 iPhone 到手表的角度来看一切都在运行.当我尝试与现有应用程序集成时,似乎有些不对劲.我在这里看到了关于这个主题的帖子(例如 WatchKit 应用程序不会在模拟器上运行) 但在我的情况下没有任何修复工作;捆绑 ID 似乎都是正确的.注意我正在尝试在 iPhone 6 而非模拟器上编译和运行.有什么建议吗?
I have successfully compiled and run the Apple Watch "Catalog" example so I know things are working from an iPhone to Watch perspective. It seems like something is not right when I try to integrate with an existing app. I have seen the posts here on this topic (e.g. WatchKit app wont run on simulator) but none of the fixes work in my case; the bundle IDs all appear to be correct. Note I am trying to compile and run on an iPhone 6 not on the simulator. Any suggestions?
推荐答案
当我更改主 iOS 应用程序的 bundle id 时,我发生了这个错误.这是我在项目浏览器中所做的
This error occurred for me when I changed the bundle id of my main iOS App. This is what I did in the project explorer
在 WatchApp 下 -->列表
Under WatchApp --> plist
WKCompanionAppBundleIdentifier ==>给出iOS App的id(com.xxxx.appname)
在 WatchApp 扩展下 -->列表NSExtension-->NSExtensionAttributes-->WKAppBundleIdentifier ==>提供您的 watchkit 应用程序的 ID(例如:com.xxxx.appname.watchkitapp)
Under WatchApp Extension --> plist
NSExtension-->NSExtensionAttributes-->WKAppBundleIdentifier ==> Give the id of your watchkit app (eg: com.xxxx.appname.watchkitapp)
这为我修复了错误.
这篇关于WatchKit 应用程序无法编译:“错误:WatchKit 扩展不包含任何 WatchKit 应用程序";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!