iosxcodewatchkitxcode11

Xcode 11 Beta won't build because of WatchKit?


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

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

enter image description here


Solution

  • 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.