Error trying to build watchOS 2 app in Xcode 7

Extension error:

"target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphonesimulator' platform"


My watch app also has this error:

Xcode/DerivedData/AnxietyTracker-aabqxayllohhlydulhldvvzxqkzv/Build/Products/Debug-watchsimulator/AnxietyTracker WatchKit Extension.appex: No such file or directory


Anyone have any suggestions or insight?

Replies

I have the same issue. Did you resolve this?

Go to top left corner of the bar in Xcode 7.0 next to the play and stop symbol. You will see your project icon. Click there(set active scheme). This error can be caused by number of issues. In my case, they automatically delete my scheme for Watch App or Watch App Extension or equivalent. Manually added it and appropriately select the type of similator compatible to my scheme.


P.S. Ascertain the WatchOS version is the one your app support via setting the "Build Settings" and your migration settings are properly adjusted. I recommend you google a sample code for WatchOS 2 project if that is the case.

same issue - right now i think its pretty much unclear how we can port watchos1 extension to watchos2 extensions - and maintain watchos1 support

I decided to retire my WatchOS 1.0 target for now and create a new 2.0 target. It became impossible to upgrade the 1.0 target. Too many moving parts in the info.list, build settings, etc. It's also too confusing to try to maintain both sets of APIs conditionally, for what amounts to perhaps 3 months more of useful life.


Porting is annoying but manageable -- openParentApplication goes away and becomes session:send . Most of the APIs have similar interfaces. The WCSession object solves some holes in the Watch/Phone interface, like signalling each partner about the availability state of the other.


Also difficult is to maintain are build settings that are backwards compatible from ios 9. I'd recommend giving up on 1.0, or (ugh) maintaining two code bases.

I got similar problem while bulding from Jenkins. In my case, SDK field had "iphoneos9.0". This caused watch os 2 app and extension to build against iphoneos.

I kept SDK field blank which forced it to take SDK setting from project configuration. Watch OS 2 app and extension got build on "watchos" and rest on "iphoneos". Product type "com.apple.product-type.watchkit2-extension" is available in watch os, so build was successful !!

In my case, most of the things were ok when I add watchkit extension with xcode 7. but debug target of the extension was iOS. So when I run in debug/simulator I got this error. I have to change them to WatchOS. and Solved.

Select Project > Targets > Supported Platform > Debug > watchOS (I had iOS here).

I've just fixed it like so:


      xcodebuild -project MyProject / -workspace MyWorkspace 
                 -scheme MyScheme
                 -destination 'name=iPhone 6s'
                 -enableCodeCoverage YES
                 clean test |
      xcpretty --color --report junit // for cleaner report styling

Hi everyone,


Does anyone have a sample project (with this "Extension.appex: No such file or directory" problem solved) well configured that I could use to imitate it?


Thanks!