App crashes only on first launch (SPGizmoPlugInManager appears to be stuck loading)

My watchOS 2 app crashes about 75% of the time when it's first launched after being installed. If you run it a second or third time, everything loads fine - and it *always* works after it successfully loads the first time. The crash does not appear to generate any crash logs, but the messages in the Watch console say:

(Error) WatchKit: <SPGizmoPlugInManager.m __59-[SPGizmoPlugInManager sendToPlugin:clientIdentifier:call:]_block_invoke:1172> after waiting for 1.0 secs, endUsing: callback for com.***.yyy.watchkitapp never fired. Giving up and hoping the next load attempt works

(Error) WatchKit: <SPGizmoPlugInManager.m __59-[SPGizmoPlugInManager sendToPlugin:clientIdentifier:call:]_block_invoke:1164> plugin com.***.yyy.watchkitapp appears to be stuck loading. trying to force it to quit

(Error) WatchKit: <SPGizmoPlugInManager.m __59-[SPGizmoPlugInManager sendToPlugin:clientIdentifier:call:]_block_invoke_2:1168> got plugInExited: callback for com.***.yyy.watchkitapp

At first I thought it must be something in my code, so I commented out all the code in awakeWithContext and willActivate, but the crashes still happened. So then I thought maybe something got messed up in the watch app target's configuration, so I added a completely blank watchOS target - with no code in it whatsoever - and it still crashes when I try to load that.


My TestFlight submission just got rejected for these crashes, so now I'm worried about my regular submission. I'm not really sure what I can do here since this seems to be a bug in watchOS, not anything to do with my code.


Has anyone else run into this issue? Any thoughts on how to fix it?


Edit: I just found this post with several developers who are experiencing the same issue. I think the problem is probably a lot more widespread, but because the crash only happens on first launch and it works fine after that, a lot of developers probably have no idea that it's even affecting their project.

Replies

This is looking more and more like some kind of installation error. If I let the app sit for ~5 minutes before opening it, the app never crashes on first launch. So maybe even though the app appears to have fully loaded on the Watch, it's not completely done yet.


You may want to test this on your devices, as this could affect your app making it through App Review.

Pretty sure App Review just rejected 3 of my watchOS 2 apps because of this, all of them are completely unrelated and all were rejected because the watch apps failed to load. I submitted 6 of them, the other 3 are still in review.

As a follow up to this, I messaged App Review explaining that this was a bug in watchOS that others were having problems with too and to try opening the apps again. They responded like 20 minutes later thanking me for the explanation and brought them all back in review.


So 1 app reviewer is aware of this problem now at least 🙂 Really good support from App Review this time though, a lot better than the slow copy-pasted responses I usually get.

Mine made it safely through review with an explanation in the Review Notes. I also included links to these forum posts.

Hi. May I ask for the bug number? If you have not yet filed a bug report, you can do so at bugreport.apple.com Please include device console logs, the build numbers of iOS, watchOS, and Xcode tht you used, and the size of your watchOS app. Thank you.

-zk

bug number : 23082596


I had reported a bug.

I've seen some odd install behavior as well, but not very reproducible. Has there been any update on your bug?

It *appears* as if this was fixed with today's watchOS 2.0.1 update. Hooray!