16

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:

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

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?

Community
  • 1
  • 1
jamey
  • 301
  • 1
  • 3
  • 6

8 Answers8

46

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. Under WatchApp --> plist

    WKCompanionAppBundleIdentifier ==> Give the id of the iOS App (com.xxxx.appname)

  2. Under WatchApp Extension --> plist NSExtension-->NSExtensionAttributes-->WKAppBundleIdentifier ==> Give the id of your watchkit app (eg: com.xxxx.appname.watchkitapp)

this fixed the error for me.

Community
  • 1
  • 1
anoop4real
  • 7,598
  • 4
  • 53
  • 56
  • Anyone who still gets the error after doing this should check out nmunjal's answer below. It solved it for me. – Matt Rundle Oct 23 '17 at 20:43
  • This answer still checks out as of Oct 2019. I discovered this when duplicating targets for a new bundle ID for the central app. – Dru Freeman Oct 09 '19 at 16:03
  • This worked for me but I had to write the bundles manually & couldn't use $(PRODUCT_BUNDLE_IDENTIFIER) – Ahmadreza Nov 27 '20 at 13:35
9

I ran into this problem on XCode Version 10.2 (10E125), i realizes when i changed WatchkitApp Bundle identifier one key in watchkitapp extension did not changed and stayed as old bundle identifier.

the path to plist: /Users/.../YourXcodeProjectFolder/Project/YourWatchkitExtensionFolder/info.plist

the problem occurd here:

<key>NSExtension</key>
<dict>
    <key>NSExtensionAttributes</key>
    <dict>
        <key>WKAppBundleIdentifier</key>
        <string>com.applecode.water.watchkit</string>
    </dict>
    <key>NSExtensionPointIdentifier</key>
    <string>com.apple.watchkit</string>
</dict>

the key WKAppBundleIdentifier was made the problem, so i changed it by my self.

Mohammad Reza Koohkan
  • 1,656
  • 1
  • 16
  • 36
5

I noticed this on Xcode version 8.2.1. Here is how I fixed it.

Go to "WatchKit App" -> Build Settings -> Packaging -> Product Name

Change it so any string different from current string. Agreed that it is a bizarre solution as called in the link below.

Source: https://blogofpuneet.wordpress.com/2015/05/02/xcode-build-error-watchkit-extension-doesnt-contain-any-watchkit-apps-verify-that-the-value-of-wkwatchkitapp-in-your-watchkit-apps-info-plist-is-set-to-yes/

Neutral Plant
  • 84
  • 1
  • 5
  • For crying out loud ... I've been stuck on the seemingly opposite "WatchKit App doesn't contain any WatchKit Extensions" error all day, and this fixed that, too. I added "foo" to the end of the product name, then ran the app and it worked for the first time, then removed "foo" and it still works. – arlomedia Jan 26 '17 at 02:58
  • Xcode 11.3.1 its still giving me same error ? Any solution pls ? – Erum Apr 03 '20 at 11:03
3

Main reasons to this error,

1 Incorrect watch app bundle id in watchkit extension plist file.

  1. Missing dependancy of watchapp.app in watchkit extension target.

Apple document with catalag example may help https://developer.apple.com/library/ios/technotes/tn2410/_index.html

sandy
  • 246
  • 4
  • 13
  • Thanks for the link. Turns out this is a key article on configuring WatchKit apps (with lots of details, etc.). One of my sample apps now works after lots of fiddling around and a second – more complicated app – still does not work and reports the same error. But at least I have a working example now. Thanks much! – jamey Aug 18 '15 at 14:38
3

Below settings worked for me

  • In Main App Info.plist

Bundle identifier:com.domain.WatchKit-table

  • In Watchkit App Info.plist

WKCompanionAppBundleIdentifier:com.domain.WatchKit-table

Bundle identifier:com.domain.WatchKit-table.watchkitapp

  • WatchKit Extension Info.plist

NSExtension>NSExtensionAttributes>WKAppBundleIdentifier:com.domain.WatchKit-table.watchkitapp

Bundle identifier:com.domain.WatchKit-table.watchkitapp.watchkitextension

Note: my bundle id has * as the third component. WatchKit-table is my project name

Prabhu.Somasundaram
  • 1,380
  • 10
  • 13
2

I noticed this with xcode 10.0 after changing the build number.

Cleaning the build folder, closing xcode, and re-opening worked for me.

Martin
  • 139
  • 4
  • 12
1

In my case I had problem with building of the extension library. In fact it was not built and I had two errors: 1. From linker about absense of the extension library. 2. From Xcode about "missing" NSExtensionPointIdentifier key.

Fix of linking error also fixed this message.

AlexeyVMP
  • 2,386
  • 3
  • 24
  • 31
0

I'm using Xamarin and Visual Studio (on the PC). I had this issue, but none of the fixes above worked. Much like the XCode fix, however, restarting Visual Studio turned out to be the answer. /sigh

Eliot Gillum
  • 832
  • 9
  • 18