2 Replies
      Latest reply on Feb 7, 2020 1:28 AM by Aofei Sheng
      tron-legacy Level 1 Level 1 (0 points)

        Every time I try using the new URLSessionWebSocketTask I eventually receive an error that crashes my app.

         

        Fatal error: Only one of message or error should be nil: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang_overlay_Foundation_Device/swiftlang-1100.2.32.33/swift/stdlib/public/Darwin/Foundation/URLSession.swift, line 46

         

        Has anyone experienced this issue? If so, do you know what's causing the problem?

         

        Development Setup:

        macOS 10.14.5 - Xcode 11 beta

        iPhone 8 Plus - iOS 13 beta

        • Re: URLSessionWebSocketTask
          tron-legacy Level 1 Level 1 (0 points)

          The version of Swift in the first Xcode 11 beta appears to be swiftlang-1100.0.38.29. I'm assuming Apple put the wrong version of Swift 5.1 beta in Xcode.

          • Re: URLSessionWebSocketTask
            Aofei Sheng Level 1 Level 1 (0 points)

            I've been getting this error randomly since I recently used URLSessionWebSocketTask, which causes my program to crash every time:

             

            Fatal error: Only one of message or error should be nil

             

            But I can't find a specific way to reproduce it, because I have no idea. It doesn't seem to be caused by network quality or any unsafe code I wrote.

             

            So I'd like to ask, have you guys encountered this error recently? I need to know if it's caused by the SDK.

             

            Xcode 11.3.1 (11C504)

            macOS 10.15.3 (19D76)

            iOS 13.3.1 (17D50)