5 Replies
      Latest reply on May 31, 2019 3:37 AM by BooRanger
      joasle Level 1 Level 1 (0 points)

        Since updating to Xcode 10, my WatchKit app is broken.

         

        Every time I try to start the app I get the following error message:

         

        -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:]:2909: Couldn't instantiate class _TtC32WatchKit_App_Extension19InterfaceController

        2018-10-01 21:51:41.579080+0200 WatchKit App Extension[2457:27053] [default] -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:]:2910: Critical failure. Simulating crash: Condition failed:"NO". Couldn't instantiate class _TtC32WatchKit_App_Extension19InterfaceController

        (lldb)

         

        The viewcontroller is the initial viewcontroller set in the Storyboard file and the all targets, modules etc. are set correctly in the Storyboard and in the Inspector as far as I can tell.

         

        I created a new project with the same WatchKit Extension setup and I can start that app - it's just a problem with my existing project, where I've added an app extension.

         

        Also tried to delete the app extension and add a completely new one to my iOS project, but with no success.

         

        Does anyone have any suggestions on how to get this to work?

        • Re: WatchKit can't initiate viewcontroller from Storyboard
          Claude31 Level 8 Level 8 (7,305 points)

          Of course you did a Clean Build Folder ?

           

          Could yopu post the func where the error occurs ?

          • Re: WatchKit can't initiate viewcontroller from Storyboard
            Aviametrix Level 1 Level 1 (0 points)

            I have the same issue. I needed to rename a working Watchkit project in XCode 10.

            Used the automatic name change for the project file and manually reset all the modules and checked all the targets. Also changed the plist names in Build settings

             

            I get the same error from failure to instantiate the initial view controller

             

            No clues found in a SO search

              • Re: WatchKit can't initiate viewcontroller from Storyboard
                lemonkey Level 1 Level 1 (0 points)

                Same issue as well. I added a watch target back in Xcode 9 which was fine, but now under Xcode 10.1 it's not recognizing the main interface storyboard with a similar error as the original post above.

                 

                Fixed: I had to re-create the Interface.storyboard in the end. Nothing would fix it until I did this. The previous version of the storyboard had an older form of a notification controller that is different in Xcode 10.1.

                • Re: WatchKit can't initiate viewcontroller from Storyboard
                  BooRanger Level 1 Level 1 (0 points)

                  For me it was the same.

                   

                  I created the extension, choice swift and added it to a objective c project.

                   

                  Xcode created the target with space in it (watch extension), which it couldn't handle I renamed it WatchExtension

                   

                  Error when space is in name:

                  <unknown>:0: error: module name "Watch Extension" is not a valid identifier

                  Command CompileSwiftSources failed with a nonzero exit code

                   

                  Remove space in nameget the runtime error:

                  Condition failed:"NO". Couldn't instantiate class _TtC32WatchKit_App_Extension19InterfaceController

                   

                  To fix I had to go to the watch (ui) target.

                  Build Settings-> select all -> search for "default Module" and rename it to your watch extension name.

                   

                  Also renamed folder to match extension name etc.