32

When I open my existing Watchkit app (Xcode 6.2), it compiles correctly, the simulators are launched (iPhone+Watch), followed by the meaningful error:

Error Launching 'xxx Watchkit Extension' SPErrorInValidBundleNoGizmoBinaryMessage

I have this issue with all simulators (iPhone 5/5S/6/6+ - 38mm/42mm)

Any ideas what the issue can be?

It seems for some reason the application does not want to run on the simulator, even though it used to. The iPhone application included in the same project does run, as do other Watchkit sample applications.

Wouter
  • 1,568
  • 7
  • 28
  • 35
  • 1
    Have you done a clear and clean build folder? The error sounds like the watch extension isn't being included in the app bundle. – Gary Riches Feb 02 '15 at 21:41
  • Still getting this error, despite following the suggestions in this post. Any other source of this problem? – R Menke Mar 27 '15 at 21:55
  • The use of the word Gizmo in the message key is interesting; I wonder if it stems from the days when the Watch was a top-secret project, so they couldn't use the word 'Watch' in the key constant. As per the early ['Project Purple'](http://www.imore.com/apple-senior-vice-presidents-phil-schiller-and-scott-forstall-share-brief-pre-history-iphone-and) days. – Carlos P Apr 13 '15 at 16:38

9 Answers9

46

Did you change the bundle ID of your app? If so you may need to manually update the WKAppBundleIdentifier in the WatchKit Extension and also the WKCompanionAppBundleIdentifier in the WatchKit App.

Reuben Bijl
  • 1,030
  • 12
  • 8
  • 3
    I ended up doing a global search for the previous bundle identifier name and that showed me where the problems were. – mwright Apr 01 '15 at 12:58
  • I don't *think* I ever renamed anything, but I ran into the same problem because the casing of the bundle identifier in WatchKit Extension > WKAppBundleIdentifier didn't match the actual bundle identifier in the WatchKit app. – dwb Apr 03 '15 at 09:29
  • Trying to rename my app and had this issue. Went to my Extension plist and updated the "WKAppBundleIdentifier". It now builds successfully but crashes before it's able to load anything (lldb)... "Couldn't instantiate class _TtC23App_WatchKit_Extension18MyInterfaceScript"... any idea why that might be – Robbie Jan 21 '20 at 19:20
23

WKAppBundleIdentifier may need to be same to WatchKit App's Bundle Identifier.

Please check WatchKit Extension's info.plist. NSExtension - NSExtensionAttributes - WKAppBundleIdentifier - xxxxx.watchkitapp

EDIT: Further explanation to clarify...

Under your App target you go to INFO tab and set Bundle Identifier to com.myapp

Then under the WatchKit Extension target you go to INFO tab and set the Bundle Identifier to com.myapp.watchkitextension

Then still under the WatchKit Extension target and still under the INFO tab you set NSExtension > NSExtensionAttributes > WKAppBundleIdentifier to com.myapp.watchkitapp

So one ends with .watchkitextension and the other ends with .watchkitapp

jsherk
  • 6,128
  • 8
  • 51
  • 83
Mao Nishi
  • 331
  • 1
  • 3
15

Check Info.plist for "Your App WatchKit Extension" & "Your App WatchKit App". First part of all indentifiers should be same.

In my case problem was in "Your App WatchKit Extension" > NSExtension > NSExtensionAttributes > WKAppBundleIdentifier.

My problem was in this string

Community
  • 1
  • 1
Nuzhdin Vladimir
  • 1,714
  • 18
  • 36
  • Did you check both plist files? Is Bundle identifier in widget info.plist equal to Bundle identifier in WatchKit Extension and equal to WKAppBundleIdentifier which is highlighted on my screen? App reinstall and deep clean(Shift+Cmd+Option+K) was helpful for me. Hope it helps =) – Nuzhdin Vladimir Mar 31 '15 at 14:40
7

Be sure you are using an 8.3 simulator.

I got this message consistently when using 8.2. Tried everything listed here and struggled with this for hours. Switching to 8.3 resolved it. Ironic, since you must set the deployment target to 8.2 at the moment, but watchkit apps need 8.3 to run I guess...

Mike Bobbitt
  • 739
  • 9
  • 12
  • You are right, this helped. Oh, and "ironic" is the politest expression which comes to my mind... – MatthiasC Jun 22 '15 at 12:21
  • Yes, except I have to use an 8.4 simulator. I get the error message consistently when using 8.2 or 8.3 simulator, but things work with 8.4 simulator. This is with Xcode 6.4. – rene Aug 07 '15 at 16:04
5

I checked all bundle identifiers multiple times but couldn't get rid of the issue. Neither did cleaning the build folder work out.

However, I was able to sort it out by turning off Game Center at the Capabilities of my WatchKit Extension.

Turning it on for the iOS host app seems to work fine, but turning it on for the WatchKit Extension results in the SPErrorInvalidBundleNoGizmoBinaryMessage error when attempting to run the WatchKit App in the simulator, while it completes building without any complaints.

I'm developing a game for Apple Watch and was looking forward to support Game Center. It was actually my plan from the very beginning to communicate with the hosting iOS app to do so, but then I saw Game Center listed in the Capabilities of the WatchKit Extension itself, so I expected to be able to deal with it right there. However, as it doesn't seem to work, I'm going to stick to my original plan to support it through the hosting iOS app.

Xcode Version 6.2 (6C131e)

EDIT: Same issue with Xcode Version 6.3 (6D570)

NexD.
  • 784
  • 6
  • 11
1

For issues on real devices (not simulator), do everything in this post: http://blog.jaredsinclair.com/post/117350678170/jareds-code-signing-tips-apple-watch-edition

Most importantly:

All three targets require the following:

a unique app ID for that target a code signing identity (applies to all targets) a unique provisioning profile for that target.

and make sure that the app ID's are consistent:

Your app IDs will look something like this:

com.company.App-Name

com.company.App-Name.todaywidget

com.company.App-Name.watchkitapp

com.company.App-Name.watchkitextension

If it still doesn't work, manually delete the app from the watch (by holding onto the icon and then hit 'x') and then try again. This was the kicker that did it for me.

Wouter
  • 1,568
  • 7
  • 28
  • 35
rocky
  • 3,521
  • 1
  • 23
  • 31
1

The procedure I solved the problem is

  1. Check if WKAppBundleIdentifier and bundle identifier in WatchKit extension and WatchKit App are correct
  2. Delete subfolders of ~/Library/Developer/CoreSimulator/Devices
  3. Delete subfolders of ~/Library/Developer/Xcode/DerivedData
  4. Clean my project
  5. Restart simulator
  6. Run
Community
  • 1
  • 1
Exile3daime
  • 611
  • 6
  • 18
1

I've been struggling with this as well. This is what solved my problem on Xcode 7.1 iOS 9. Just Make sure you follow the naming below for your identifiers:

  • Target - com.myCompany.myApp
  • Watchkit app - com.myCompany.myApp.watchkitApp
  • Watchkit extension - com.myCompany.myApp.watchkitApp.watchkitextension

The extension should have the identifier of the WatchKit app target + .watchkitextension

Wouter
  • 1,568
  • 7
  • 28
  • 35
0

I've tried everything posted thus far in this thread but still couldn't get it to work. I resorted to backtrack to the point when it was working and retrace every single action that I've done to figure out at which point it breaks...

As it turned out, the WatchKit App's info.plist file does not like any custom plist entry, at least that is what I've found out in my case. I've added an entry called "MyAppBundlePrefix" and it caused the "Error Launching 'xxx Watchkit Extension' SPErrorInValidBundleNoGizmoBinaryMessage"

I wish XCode would offer a little bit more specific detail for that error but it took me about 5 hours to find it out by brute force way.

Kevin T.
  • 13
  • 1