WatchWidget does not define either an NSExtensionMainStoryboard or NSExtensionPrincipalClass - because it can't!

Ok, weird one here. I have a widgetkit watch extension that I'm transitioning to. All code compiles clean, but when I go to install I get an error that it can't be installed on the watch because the extension does not define either a NSExtensionMainStoryboard or an NSExtensionPrincipalClass key. I don't have a storyboard for the extension as it's for the complications, so I added a principal class key.

Now it won't install with the error that it defines a principal class which is not allowed for the extension point com.apple.widgetkit-extension.

Huh. Well, ok, um... I guess I'll rip it out and stay with the deprecated clock kit complications, since they at least install. But this is very frustrating, and makes me think Apple wants us to go insane!

I recently had this issue, too. I have no idea how it got fixed, but this is what I have in the Info:

  • Main app - does not have this key.
  • Widget extension (Home Screen widgets and Lock Screen widgets) - has NSExtension containing NSExtensionPointIdentifier only.
  • Watch App - does not have this key.
  • Complications widget extension - has NSExtension containing NSExtensionPointIdentifier only.

So, I got this error, added one of the keys and it didn't work so I removed them and it all worked fine.

I know this is probably a rubbish response, but it works as it is now without those keys, so maybe try it?

There's a similar thread here: https://forums.developer.apple.com/forums/thread/732892

It didn't help me. What happens to me is that if I define NSExtensionPrincipalClass, the organizer won't let me upload to AppStore because NSExtensionPrincipalClass is unexpected. If I remove NSExtensionPrincipalClass, TestFlight fails to install because NSExtensionPrincipalClass is missing...

WatchWidget does not define either an NSExtensionMainStoryboard or NSExtensionPrincipalClass - because it can't!
 
 
Q