WeatherKit error on iOS 17 - macOS 14

Hi I upgraded my Mac to test the new os and iOS 17. But I have problems with the weather kit on the app.

WeatherKit enabled as app service and capability there was no issue with the iOS 16.

What could be the problem?

import Foundation
import WeatherKit

class WeatherKitManager: ObservableObject {
    @Published var weather: Weather?
    @Published var isFetchingWeather = false
    
    func getWeather(latitude: Double, longitude: Double) async {
        do {
            let receivedWeather = try await WeatherService.shared.weather(for: .init(latitude: latitude, longitude: longitude))
            DispatchQueue.main.async {
                self.weather = receivedWeather
            }
        } catch {
            fatalError("\(error)")
        }
    }
    
    var symbol: String {
        weather?.currentWeather.symbolName ?? "xmark.app"
    }
    
    var temp: String {
        if let temp = weather?.currentWeather.temperature.converted(to: .celsius) {
            let formattedTemp = String(format: "%.1f", temp.value)
            return "\(formattedTemp)°C"
        } else {
            return "Yükleniyor..."
        }
    }
}

Errors here

Ceyehat/WeatherKitManager.swift:22: Fatal error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Encountered an error when fetching weather data subset; location=<+37.78583400,-122.40641700> +/- 0.00m (speed -1.00 mps / course -1.00) @ 06/06/2023, 5:32:55 PM GMT+03:00,  error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

I'm seeing the same issue.

Same issue

Problem with WeatherKit, but doesn't work only on the simulator. On the device it works as before. When running on the simulator I get this error: Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

I'm having the same issue. I tested from Xcode 15 beta and it's simulator and Xcode 14 with that simulator. In both versions the IOS 17 image fails.

So it's the simulator the problem? Everything actually points to the simulator as the cause of this issue...

I am having this issue in both the iOS 17 Simulator and on my device running iOS 17 Beta. Hopefully next betas fix this issue.

Experiencing the same problem! Filed a radar: FB12280733

Likewise; filed a dupe: FB12326804.

I am also completely unable to retrieve a forecast in the simulator using Xcode 15 beta 1.

I'm also seeing the same issue with WeatherKit on iOS 17 / Xcode 15 beta 1. I noticed that others are experiencing more general issues with entitlements apparently not working in Xcode 15 B1, even when configured correctly:

https://developer.apple.com/forums/thread/731010

https://developer.apple.com/forums/thread/731116

I'm wondering if the WeatherKit issue we are seeing is a specific instance of this issue -- in this case, the com.apple.developer.weatherkit entitlement not getting picked up correctly. I could imagine this potentially causing auth issues on the backend. Speculation at this point, but it seems to fit.

This is still a problem for me on Xcode 15 beta 2.

I inspected the built .app using codesign:

codesign --display --entitlements :- YourApp.app

And it is in fact missing the com.apple.developer.weatherkit entitlement, despite the fact that it is included in the project's Entitlements file.

Beta 2 did not resolve this... ? seems nutty that a major API just is dead in a beta with tons of people in it but...

I've been getting this same issue on Simulator since Xcode 14 and iOS16 release, seems like it still isn't fixed. It has been especially frustrating because the WeatherKit issue causes some of my CI/CD pipelines to always fail

I'm starting to get support emails from users running the iOS 17 beta reporting that they can't retrieve weather forecasts with my app.

This issue still exists for me in Xcode 15 Beta 3.

I am very surprised that this hasn't been addressed yet, or even mentioned in the Release Notes. Based on the discussion in this thread, no apps using WeatherKit can be built or run on iOS 17 yet.

Has anyone been successful in getting WeatherKit to work on iOS 17?

I also have had this issue since Beta 1. It fails on the simulator and on device. The code previously worked in iOS 16/macOS 13. I confirmed that I have the correct entitlements enabled.

In the simulator, I get the error mentioned in the original post.

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

On device, I get a different error

Unable to decode object=, error=keyNotFound(CodingKeys(stringValue: "humidityMax", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "forecastDaily", intValue: nil), CodingKeys(stringValue: "days", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0)], debugDescription: "No value associated with key CodingKeys(stringValue: \"humidityMax\", intValue: nil) (\"humidityMax\").", underlyingError: nil))

I filed feedback separately since I wasn't sure if this was the same problem. The simulator error is filed as FB12539864 and the on-device error is filed as FB12539932.

I've been seeing this too and also starting to get support email as as more people move on to the beta. Really hope this can be resolved before volumes start to increase with the public beta. Also filed a radar 12561778 and am happy to provide more details if helpful, but the error messages I'm seeing are exactly as reported above and trivial to reproduce.

Same issue. Hoping Apple will fix soon as I now also start getting user feedback.

I'm seeing the same issue. I created a minimal WeatherKit app and it runs fine on Xcode 15 beta 4 using a iOS 16.4 simulator. On an iOS 17 beta 3 simulator it fails with the following error message:

Aborting silent interpolation: missing cached hourlyForecast; location=CLLocationCoordinate2D(latitude: 35.157019886059835, longitude: -85.34119394760656)
Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Encountered an error when fetching weather data subset; location=<+35.15701989,-85.34119395> +/- 0.00m (speed -1.00 mps / course -1.00) @ 7/13/23, 8:29:48 PM Eastern Daylight Time,  error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

I've filed this as feedback FB12602396

This continues to fail for me on Xcode 15 beta 4 on the iOS 17 simulator.

Same authentication error to the WeatherService.

As of iOS 17 beta 4, WeatherKit appears to be returning data for the daily WeatherQuery again on device. In previous betas this always returned an empty array for me, but did not produce an error.

I'm also no longer seeing the com.apple.weatherkit.authservice error when building in the simulator with Xcode 15 beta 5.

THANK YOU, WEATHERKIT TEAM!

This appears to now work on Xcode 15/iOS 17 beta 5.

I'm running into this issue on Xcode 15 beta 7. It's the first time I've used WeatherKit. I've wasted a couple of hours banging my head, asking where I went wrong in the setup. I guess this will go into the backlog. 😥

Actually, I'm not 100% sure it's related to this but seems like it:

Aborting silent interpolation: additional missing products that need to be fetched from the server anyway; location=CLLocationCoordinate2D(latitude: 34.177833894365044, longitude: -84.1331046257825), missing products=[WeatherDaemon.WeatherProduct.currentWeather, WeatherDaemon.WeatherProduct.forecastNextHour, WeatherDaemon.WeatherProduct.forecastHourly, WeatherDaemon.WeatherProduct.forecastDaily, WeatherDaemon.WeatherProduct.weatherAlerts, WeatherDaemon.WeatherProduct.airQuality]
Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Encountered an error when fetching weather data subset; location=<+34.17783389,-84.13310463> +/- 3210.23m (speed 0.00 mps / course 0.00) @ 8/27/23, 11:23:51 AM Eastern Daylight Time,  error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

I am very first time to use WeatherKit eventhough 8 years experience as of 73 year old programmer. I faced same error, but I was missing to check two tags on the following instructions; the mistakeI took was the last instruction on NOTE, which is App Capability tag. Please check again two tags, App Services tag and App Capability tag.

Configure app services WeatherKit WeatherKit allows you to access the Apple Weather service.

Enable WeatherKit for an App ID In Certificates, Identifiers & Profiles, click Identifiers in the sidebar.

On the top left, click the add button (+), select App IDs, then click Continue.

Register an App ID.

Click the App Services tab.

Select the WeatherKit checkbox.

Click Continue, review the registration information, and click Register.

Note : Remember to also enable WeatherKit in the App Capabilities tab when editing your App ID.

WeatherKit error on iOS 17 - macOS 14
 
 
Q