Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting a strange error : nw_protocol_get_quic_image_block_invoke dlopen libquic failed in SwiftUI?

Tags:

swift

api

swiftui

Disclaimer: I am new to Swift and IOS in general, so please keep that in mind!

While attempting to connect to an API, I am receiving the following error: nw_protocol_get_quic_image_block_invoke dlopen libquic failed.

Please find below the code used:

@State public var data = PoemData(title: String("Poem Name"), content: String("Poem Content"), poetData: PoetData(name: "Poet Name"))
    
    func getData() {
        let urlstring = "https://www.poemist.com/api/v1/randompoems"
        let url = URL(string: urlstring)
        
        URLSession.shared.dataTask(with: url!) {data, _, error in
            
            DispatchQueue.main.async {
                
                if let data = data {
                    do {
                        let decoder = JSONDecoder()
                        let decodedData = try decoder.decode(PoemData.self, from: data)
                        self.data = decodedData
                        
                    } catch {
                        print ("Error! Something went wrong, yikes")
                        
                    }
                }
                
            }
        }.resume()
    }

And the data model:

import Foundation

struct PoemData: Decodable {
    public var title: String
    public var content: String
    public var poetData: PoetData
    
}

struct PoetData: Decodable {
    var name: String
}

Any ideas?

like image 807
Simbeul Avatar asked Nov 28 '20 22:11

Simbeul


1 Answers

This is purely a Simulator message. It won't happen on a device, and it doesn't affect the behavior of your app, so just ignore it.

like image 51
matt Avatar answered Oct 20 '22 09:10

matt