I got exactly the same issue. CFNetwork should be importable after WatchOS 2.0 but it seems not to be in the list of frameworks. I'm also running the xcode beta version.
Hi! I'm also having problems with CFNetwork in watchOS 6 beta 6. I'm using URLSessionWebSocketTask and the app seems to crash because it's missing access to something in the CFNetwork framework.
This is a simplified version of my code:
let url = URL(string: “ws://127.0.0.1:8080”)! let urlSession = URLSession(configuration: .default) let task = urlSession.webSocketTask(with: url) self.webSocketTask = task task.resume()
(I've set up a local websocket server, but also tried with public websocket 'echo' servers)
When trying to connect with the code above, the app crashes and I don't get any error messages in the "Debugger output", but I do get the following output in the "Debug navigator":
[... Lots of instructions ....]
0x4286c54a <+446>: testb %al, %al
0x4286c54c <+448>: jne 0x4286c6b3 ; <+807>
0x4286c552 <+454>: movl %esi, (%esp)
0x4286c555 <+457>: calll 0x428e87de ; symbol stub for: objc_release
0x4286c55a <+462>: movl -0x30(%ebp), %eax
0x4286c55d <+465>: movl 0x250292bf(%eax), %eax
0x4286c563 <+471>: movl (%ebx,%eax), %eax
-> 0x4286c566 <+474>: movl (%eax), %ecx
[... Lots of more instructions ....]
And on the left hand side in xcode, it says
I've tried lots of things like variations on the code, trying to import the CFNetwork framework with no luck.
If I understand this correctly "lldb_unnamed_symbol" is becuase the app is missing a library it's trying to use.
So it seems to me like the implementation of URLSession (which is new in watchOS 6) is incomplete in some way that's connected to the CFNetwork framework
Any Apple people here to help out?
In the latest beta - watchOS 6 beta 7, it says in the release notes that:
- To enhance security,
URLSessionno longer sniffs the MIME type when the server sends
Content-Type: application/octet-stream. (7820658)
NSURLRequest.CachePolicy.reloadIgnoringLocalAndRemoteCacheDataAPIs are now available. (49660334)
URLSessionStreamTaskare now available for use in watchOS apps. (49779789)
However, after installing beta 7 on my apple watch, I still get the exact same crash.
- To enhance security,
I am also getting this error. Did you ever manage to solve it? task.resume() does not cause a crash for me when the websocket server is wss://echo.websocket.org (a public websocket test server). However, when I use my own websocket server, it causes a crash, even though my server works when invoked from other platforms/frameworks (such as React Native). Thanks.
I have also meet the same issue, what I did is try to migrate an iOS static library which base on CFNetwork to WatchOS. Do you have find the solution?