11

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 kept getting this error and didn't know why after searching all the other questions here, took forever to figure this out.

ZachNag
  • 503
  • 3
  • 14
  • This is not Resolved! – Gabriel May 07 '15 at 10:44
  • @Gabriel Check the answers - I answered my own question thus the title. There appears to be different causes/solutions to this error, but the accepted answer is the one that solved it for me specifically. – ZachNag Jun 03 '15 at 19:36

9 Answers9

11

The solution was really simple. A while back I had removed a few files and re-added them to the extension, but they didn't get added back to compile sources.

Added the exention's .m files back into it's compile sources and the error went away.

Very misleading error message.

ZachNag
  • 503
  • 3
  • 14
  • i got the same error. I have to clean the build every time. Any help please? – Gabriel Apr 11 '15 at 20:19
  • Be careful not to accidentally select any .h files when you do this. Results in an entirely different set of errors, but in case you accidentally do this, you'll now know what to look for. – Beltalowda Mar 03 '16 at 00:17
6

this solved the problem for me:

  • go to WatchKit Extension | Build Phases | Copy Bundle Resources
  • click the +
  • search the products folder and choose WatchKit App.app

afterwards clean and rebuild

donmarkusi
  • 346
  • 2
  • 13
  • i got the same error. I have to clean the build every time. Any help please? – Gabriel Apr 16 '15 at 15:14
  • Great! this solved my issue. I just removed and put it back the WatchKit App.app to the "Copy Bundle Resources" and it worked. The Info.plist "WKWatchKitApp" was set to YES. – loretoparisi Sep 19 '15 at 17:33
4

I had the same issue.

My problem was that by renaming target, I ended up with the same Product Name for the Main app and the Watchkit App, resulting in overriding themselves while building.

So everytime I cleaned the build, on the first install it was actually working, but on the second one I was alwas getting this Error.

When I realized the problem, I also found out that Renaming the product name of the WatchKit App wasnt fixing the issue because XCode doesnt really update all the references to the WatchKit Extension target, maybe there will be a fix later for this. (At the moment i am using XCode 6.3.1)

Renaming the Product Name of the main app to a different name, fixed anyways the problem.

Afterwards cleaned and rebuilt and never had that problem again.

Alessio
  • 41
  • 2
3

I had to change the compiler for extension & watch app, probably because I added Watchkit App to old project.

Go to Build Settings "Compiler for C/C++/Objective-C" of extension and watch app, and make sure it's "Default Compiler".

da1
  • 487
  • 5
  • 10
2

I had changed the autogenerated Bundle ID and then hit the same error.

I found that the value in the WatchKit Extension plist needed to get updated. Do a global search on this "WKAppBundleIdentifier" and then make it match the bundle id of your WatchKit app. This fixed the error for me.

MStudios
  • 1,073
  • 1
  • 12
  • 14
2

I was able to fix this error by removing the extension's binary from "Embedded Binaries" in Main App's "General Settings".

It should look like this after removing the binary

I think that was still in there from the time I created the watch-target, which was for Watch OS 1.

appleitung
  • 1,043
  • 7
  • 10
  • I was struggling with the same issue – trying to integrate with an existing app – and this solution was the only one that worked. At least I can now compile successfully. Thanks for the tip! – jamey Sep 29 '15 at 00:22
0

After weeks and weeks of investigations i finally found out the problem.

The product name of the Iphone App was the same as the product name of the Watch App.

Once i changed the Product Name of the WatchApp it worked.

  1. go to your targets. Select the watch app target
  2. go to build settings. Search for Product Name
  3. Edit your Product name to be different than the App Target!
  4. Clean and Build. Should Work. Thanks
Gabriel
  • 1,215
  • 13
  • 16
  • I don't see why this was down voted, someone else mentioned this as a problem in one of the uprooted answers – lewis Nov 02 '16 at 07:10
0

I found that in extension sources it was pointing to Debug-iphoneos location of WatchKitApp so readding it fixed the problem

Marcin Małysz
  • 733
  • 8
  • 12
-1

I recently came across this error and after spending many hours trying to get away with it, it seems I finally managed. Read about the solution here: https://blogofpuneet.wordpress.com/

Puneet Sharma
  • 9,369
  • 1
  • 27
  • 33