I posted an earlier reference but I think this one is more accurate and reflective. So I am making a call to the USGS api to pull some water gauge information. My calls worked perfectly until built with Swift 5.3 (Xcode 12). I am able to get a 200 status code but then after multiple seconds of text appearing and disappearing in the debug console, I get this error:
Fatal error: Can't remove first element from an empty collection: file Swift/RangeReplaceableCollection.swift, line 624
This occurs during the response generation and not in parsing the JSON (never makes it to that point). The app crashes with an unexpectedly unwrapped nil error. I have seen others have a similar issues with certain API calls, and some are even having the issue when querying HealthKit! This seems to be an error in the Swift codebase so not sure what can be done, but any help or suggestions would be welcome.
Thanks!
Mark
Fatal error: Can't remove first element from an empty collection: file Swift/RangeReplaceableCollection.swift, line 624
This occurs during the response generation and not in parsing the JSON (never makes it to that point). The app crashes with an unexpectedly unwrapped nil error. I have seen others have a similar issues with certain API calls, and some are even having the issue when querying HealthKit! This seems to be an error in the Swift codebase so not sure what can be done, but any help or suggestions would be welcome.
Thanks!
Mark