weatherkit: failed to generate jwt token

Hey,

I'm trying to update my old app that used DarkSky to WeatherKit, and struggling. I always get:

ailed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

This is regardless if I do it on my iPad, or in the simulator. I have done the following:

  • Selected WeatherKit on the Capabilities and App Services tabs of the Identifier section on developer.
  • Put it under signing and capabilities in XCode

I've tried making a new provisioning profile, cleaning build folder, etc. Not sure what to do here. I suspect part of this problem is that I developed this app in 2018 and now I'm trying to update it.

I am able to run the app on TestFlight, but not as an internal tester. Apple won't let me, so I have to add myself as an external tester.

Thanks for any help you can provide!

Thanks for reaching out. This seems like a similar issue as the developer experienced in https://developer.apple.com/forums/thread/772299.

I would recommend you to verify whether you can make it work using a new test app. If that works, it seems your guess is correct and somehow the WeatherKit capability is not propagated correctly in your existing project.

I will try that and let you know how it goes.

Works like a champ on my test app. Perhaps my real app is so old that the configuration is messed up somewhere in there.

Any help? I've spent a few hours now comparing the two apps, changing entitlement files, etc. I'm also using Cursor with premium calls to debug this, and having 0 luck.

It will be hard to debug this without seeing the actual project configuration. Somehow the entitlements do not seem to be configured correctly in your old project. Two things I would recommend:

  • Remove your entitlements file and recreate it by enabling WeatherKit under "Signing & Capabilities" in your Xcode project
  • Update your bundle identifier to the one from your test app, and see if things work. If that's the case, there might still be a configuration issue on the Developer Portal side

If the above does not resolve the issue, I would recommend to try to reproduce the issue in a small Xcode project (if possible), by for example removing the biggest chunk of your source files until you have a small Xcode project that still reproduces the same WeatherKit issue.

Once you have that, you can follow the steps under https://developer.apple.com/support/technical/ to file a request for help. Make sure to include:

Please share the request/feedback ID here.

Hello! I am seeing the same thing happening on my App, which is on the AppStore and used to work perfectly up until this morning.

After attaching a network debugger on my Mac, I'm seeing this 401 HTTP error:

I have, of course, enabled WeatherKit on both Capabilities and App Services tabs on the Dev Portal.

When running on Xcode and/or debugging via the Console, I see the same error:

Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

Let me repeat: this is affecting the App that's currently deployed to the Store and has worked without hiccups before this morning.

Please help because my customers are already writing!

What's interesting is that the Widgets work...

And i'm certain that the error started from Sunday to Monday, when I wasn't working...

weatherkit: failed to generate jwt token
 
 
Q