Another clue? Following the example at https://blog.makwanbk.com/weatherkit-build-a-simple-ios-weather-app, I put the following code in my playground and got the error below. It's pretty much the same as before but now expressed in a localized description.
I was looking at my developer account and discovered I have no current provisioning profiles. Would that do it? As I said the Airport Forecast example app works in Simulator
| import UIKit |
| import WeatherKit |
| import CoreLocation |
| |
| let service = WeatherService() |
| let currentLocation = CLLocation(latitude: 37.7749, longitude: 122.4194) |
| do { |
| let weather = try await service.weather(for: currentLocation) |
| print(weather) |
| let currentWeather = Weather(temperature: weather.currentWeather.temperature.value, |
| condition: weather.currentWeather.condition.rawValue, |
| symbolName: weather.currentWeather.symbolName, |
| humidity: weather.currentWeather.humidity, |
| isDaylight: weather.currentWeather.isDaylight) |
| print(currentWeather) |
| } catch { |
| assertionFailure(error.localizedDescription) |
| } |
| |
| struct Weather { |
| let temperature: Double |
| let condition: String |
| let symbolName: String |
| let humidity: Double |
| let isDaylight: Bool |
| |
| static func empty() -> Weather { |
| Weather(temperature: 0, |
| condition: "", |
| symbolName: "", |
| humidity: 0, |
| isDaylight: false) |
| } |
| } |
__lldb_expr_17/Weather.playground:31: Fatal error: The operation couldn’t be completed. (WeatherDaemon.WDSJWTAuthenticatorServiceProxy.Errors error 0.)