I’ve been following Chris’s tutorials and now I am doing the Youtube App tutorial. However, since part 4, I’ve been stuck with this error in the console:
2020-07-27 22:20:45.633786+0200 YoutubeApp[3539:242126] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fa4ba414ee0] get output frames failed, state 8196
2020-07-27 22:20:45.633944+0200 YoutubeApp[3539:242126] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fa4ba414ee0] get output frames failed, state 8196
2020-07-27 22:20:45.634346+0200 YoutubeApp[3539:242126] TIC Read Status [1:0x0]: 1:57 2020-07-27 22:20:45.634438+0200 YoutubeApp[3539:242126] TIC Read Status [1:0x0]: 1:57
I have searched all over the internet but haven’t found any clear solution.
I also tried to use the debugger and breakpoints to see if it comes into the parsing bit but it doesn’t seem to enter it at all. The app just hangs there for quite some time until I get the error. Nothing parsed into video objects. Here’s the code that the program doesn’t enter.
do {
// Parsing the data into video objects
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .iso8601
print("Preparing to decode")
let response = try decoder.decode(Response.self, from: data!)
print("Decoding successful, printing response")
print(response)
if response.items != nil {
DispatchQueue.main.async {
// Call the "videosFetched" method of the delegate
self.delegate?.videosFetched(response.items!)
}
}
}
catch {
print("There was an error trying to parse the data into videos")
}
I would also like to mention that once updating the project on GitHub and testing it on Bitrise, I get no errors as everything is successful.
Here you go. I edited the last bit of the topic adding in that Bitrise receives no errors. Why would that be?
You might also notice how the variable/constants names and function argument names are white when the theme sets it to green. Should I adress that issue in a seperate topic?
Your second test block where you test for error == nil && data != nil - will test as true and then print out “No errors but there’s data” and then the next instruction is a return statement which will cause the function to exit and go no further.
Remove the return statement and your code will get through to the JSON Decoder and likely complete successfully.
I’ve marked a square around a section of code that by convention is normally before the do { instruction. It makes no material difference in this case but you will find that it is conventional nevertheless that the do { } only has the JSON code such as:
do {
let response = try decoder.decode(Response.self, from: data!)
if response.items != nil {
// Call the "videosFetched" method of the delegate
DispatchQueue.main.async {
self.delegate?.videosFetched(response.items!)
}
}
} catch {
This seemed to only have solved the problem where nothing was parsed and shown in the TableViewCells. I am still getting the same error after a few minutes.
I have already checked the items array and if the program entered the parsing bit in the console after removing return. It all worked and I successfully parsed everything, so that’s not a problem anymore.
What I meant was when I let the simulator stay on for a while after the response has been parsed, I get an error that I mentioned above.
The error itself does not pose any issue when I run the program, it just pops up after a few minutes.