由于 WatchKit,Xcode 11 Beta 无法构建? [英] Xcode 11 Beta won't build because of WatchKit?

查看:37
本文介绍了由于 WatchKit,Xcode 11 Beta 无法构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Xcode 10 上工作.现在在测试版中我无法构建我不断收到此错误:

Worked on Xcode 10. Now in the beta I can't build I keep getting this error:

为 iOS 模拟器构建时,WatchKit"不可用.考虑使用 #if !os(iOS) 有条件地导入这个框架.

a "WatchKit" is not available when building for iOS Simulator. Consider using #if !os(iOS) to conditionally import this framework.

推荐答案

对于 WatchKit 扩展中的一个 swift 文件,我遇到了同样的问题.原来它是 iOS 应用程序和 WatchKit 扩展的成员.我在文件的目标成员资格部分取消勾选 iOS 应用程序,以便它只属于 WatchKit 扩展目标.现在项目构建成功.

I had the same issue for one swift file in the WatchKit Extension. It turned out that it was a member of both the iOS app and the WatchKit Extension. I unticked the iOS app in the target membership section for the file so that it only belongs to the WatchKit Extension target. Now the project builds successfully.

这篇关于由于 WatchKit,Xcode 11 Beta 无法构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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