2

I try to build my watch app and I keep getting an error

createViewController:className:properties:contextID:info:gestureDescriptions:
clientIdentifier:]:2916: Critical failure. Simulating crash: Condition failed:"NO". 
Couldn't instantiate class _TtC12STracker23InfoInterfaceController

I had to rename my project at some point and according to my research it can be the cause of the problem. I recreated from scratch the Interface.storyboard and InfoInterfaceController but it did not help.

Siong Thye Goh
  • 3,518
  • 10
  • 23
  • 31
vlpsk
  • 25
  • 4

5 Answers5

6

That is not a good way to solve such problems specially when someone has bigger WatchOS App Project and deleting all and recreating is absurd and time consuming.

first check if you did rename your project correctly by following steps in this answer by Luke West: https://stackoverflow.com/a/35500038/7345611

then do these steps:

  1. go to interface.storyboard located at left navigator pane in Xcode

  2. select the yellow circle on top of a interfaceController

  3. go to it's identity inspector
  4. in class section, reassign your class to that interfaceController by retyping the class name and hitting enter which Xcode will updates the module section under it automatically. (all your problem lie in Module Section where Module still has the old name assigned to it)
  5. do the same process for all interfaceControllers and customClasses(if you have any) and everything that you assigned a class to it before.

now the app should run as expected.

Developersian
  • 151
  • 2
  • 7
0

This is due to Module Which will be pointing to Watch App Instead of Extension as these all files exist in the Extension Module, you can directly change the Module of Watch StoryBoard file InterfaceController, NotificationController and if any default created interfaces.

BobMorane
  • 3,870
  • 3
  • 20
  • 42
0

In the "Build Settings" of your WatchKit App target, make sure to update IBSC_MODULE (Default Module). Set it to the WatchKit Extension module name (in iOS apps IBSC_MODULE can be left empty and will automatically point to the target's module). The module name is the name of the target's product name (which is often also the target's name) with spaces replaced by underscores. In case your UI classes are in a framework, use the framework's module name instead of the WatchKit Extension module name.

For example, if your WatchKit Extension target is "My WatchKit Extension", in your "My WatchKit App" target go to "Build Settings" and change IBSC_MODULE to "My_WatchKit_Extension".

As mentioned by sandydhumale, select your Interface Controller in the Storyboard and in the Identity Inspector make sure to check the "Module" field under the "Class" field. An empty "Module" field means the class will be searched in the default module (set by IBSC_MODULE).

davidisdk
  • 3,358
  • 23
  • 12
0

Was dealing with this same issue myself. I guess with the newest Xcode update my watch extensions module name was changed. What ended up working for me was to go in to my main watch extensions storyboard and rename the module for each interface controller in the properties inspector.

Zachary Bell
  • 559
  • 4
  • 18
-3

So I've solved the problem by deleting all watch targets and files and recreating them

vlpsk
  • 25
  • 4