3

I'm building a simple Xcode project to help me calculate taxes. I'm requesting an xml url but getting the error:

[boringssl] boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics

I've rode that the error can disappear if you test it on a real device, but I've still got the error.

import UIKit

    class DetailViewController: UIViewController {
    
    var model: DetailModel?

    override func viewDidLoad() {
        super.viewDidLoad()
        loadSteuer()
        // Do any additional setup after loading the view.
    }
    
    func loadSteuer(){
        
        let url = URL(string: "https://www.bmf-steuerrechner.de/interface/2022Version1.xhtml")!
        guard var components = URLComponents(url: url, resolvingAgainstBaseURL: false )else {
            return
        }
        
        let queryItemCode = URLQueryItem(name: "code", value: "Lohn2022")
        let queryItemLzz = URLQueryItem(name: "LZZ", value: "1")
        let queryItemRe4 = URLQueryItem(name: "Re4", value: model?.bruttolohnCents)
        let queryItemStk1 = URLQueryItem(name: "STKL", value: model?.steuerklasseString)
        let queryItemAJahr = URLQueryItem(name: "AJAHR", value: model?.alterString)
        components.queryItems = [queryItemCode, queryItemLzz, queryItemRe4, queryItemStk1, queryItemAJahr]
        
        guard let queryURL = components.url else {
            return
        }
        
        let request = URLRequest(url: queryURL)
        URLSession.shared.dataTask(with: request) {[weak self] (data, response, error) in
            guard let data = data, error == nil else{
                return
            }
            
            let parser = XMLParser(data: data)
            parser.delegate = self
            parser.parse()
            
        }.resume()
    }
    }

    extension DetailViewController: XMLParserDelegate {
    
     func parser(_ parser: XMLParser,
                didStartElement elementName: String,
                namespaceURI: String?,
                qualifiedName qName: String?,
                attributes attributeDict: [String : String] = [:]) {
        switch elementName {
        case "ausgabe":
            
            if attributeDict["name"] == "LSTLZZ"{
                print(attributeDict["value"])
            }
            
            if attributeDict["name"] == "SOLZLZZ"{
                print(attributeDict["value"])            }
            
        default:
            break
        }
    }
}
5
  • I have no explanation but found this on apple site Commented Feb 14, 2022 at 7:51
  • Also found this other one Commented Feb 14, 2022 at 7:55
  • 1
    @PtitXav yes i saw this solution already but it doesnt fix the problem its just disabling the appearing in the console and other important errors. so thats not a good solution cause im losing important information but the code still not work :/ Commented Feb 14, 2022 at 11:59
  • Was is the xml format of element ausgabe ? Something like <ausgabe name="nnnn" value="vvv" >…. Commented Feb 14, 2022 at 12:15
  • Firebase needs to answer this question; it's embarrassing their software causes ugly complaints in the console for programs which are running well. Commented Jun 21, 2022 at 16:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.