WatchKit App无法编译:“错误:WatchKit扩展不包含任何WatchKit应用程序” [英] WatchKit App won't compile: "error: WatchKit Extension doesn't contain any WatchKit apps"

查看:153
本文介绍了WatchKit App无法编译:“错误:WatchKit扩展不包含任何WatchKit应用程序”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这个问题上有几个帖子,但提议的解决方案都不适合我的情况。我正在尝试按照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 Extension不包含任何WatchKit应用程序。验证
在WatchKit应用程序的Info.plist中WKWatchKitApp的值是
设置为YES。

"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到Watch的角度都在运行。当我尝试与现有应用程序集成时,似乎有些不对劲。
我在这个主题上看过帖子(例如 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应用程序的软件包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


  1. 在WatchApp下 - > plist

  1. Under WatchApp --> plist

WKCompanionAppBundleIdentifier ==>提供iOS应用程序的ID(com.xxxx.appname)

在WatchApp扩展下 - > plist
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 App无法编译:“错误:WatchKit扩展不包含任何WatchKit应用程序”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆