URLSession GET request fails on eduroam - swift

I am running into a strange error with Swift 3.
I am trying to request a URL in a Swift application but the request always fails. I have tried opening different URLs and opening the URLs in my browser, where the requests work.
I am using the following code snippet I found online:
let url = URL(string: "https://httpbin.org/ip")
let task = URLSession.shared.dataTask(with: url!) { data, response, error in
guard error == nil else {
print(error!)
return
}
guard let data = data else {
print("Data is empty")
return
}
let json = try! JSONSerialization.jsonObject(with: data, options: [])
print(json)
}
task.resume()
This is the error my program is producing
2018-04-30 11:11:08.318299+0200 TokenList[2765:48745] PAC result block not invoked
2018-04-30 11:11:08.318361+0200 TokenList[2765:48745] [] nw_proxy_resolver_create_parsed_array PAC evaluation error: kCFErrorDomainCFNetwork: 308
2018-04-30 11:11:08.318380+0200 TokenList[2765:48737] Received XPC error Connection invalid for message type 3 kCFNetworkAgentXPCMessageTypePACQuery
2018-04-30 11:11:08.318880+0200 TokenList[2765:48745] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
2018-04-30 11:11:09.319675+0200 TokenList[2765:48745] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
2018-04-30 11:11:10.322336+0200 TokenList[2765:48745] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
2018-04-30 11:11:11.323967+0200 TokenList[2765:48745] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:10 Err:-1 Errno:1 Operation not permitted
2018-04-30 11:11:11.324569+0200 TokenList[2765:48745] [] nw_resolver_create_dns_service_locked DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2018-04-30 11:11:11.325512+0200 TokenList[2765:48745] TIC TCP Conn Failed [1:0x6000001630c0]: 10:-72000 Err(-65563)
2018-04-30 11:11:11.326603+0200 TokenList[2765:48737] Task <F194834F-65B5-4E6D-B088-B4947A029818>.<1> HTTP load failed (error code: -1003 [10:-72000])
2018-04-30 11:11:11.326897+0200 TokenList[2765:48737] Task <F194834F-65B5-4E6D-B088-B4947A029818>.<1> finished with error - code: -1003
Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x600000442250 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, NSErrorFailingURLStringKey=https://httpbin.org/ip, NSErrorFailingURLKey=https://httpbin.org/ip, _kCFStreamErrorDomainKey=10, _kCFStreamErrorCodeKey=-72000, NSLocalizedDescription=A server with the specified hostname could not be found.}
I am suspecting this issue could be caused by me being on eduroam, the heavily gated university wifi. On the other hand other requests (from other macOS) applications are working fine.
Additionally there should be no issues with misconfiguration on the Mac is it is brand new and only homebrew and a few programs have been installed.
I am looking forward to any pointers you might have and would like to thank you in advance.

Related

Swift Admob does not show Ad

I am trying to implement an Google AdMob banner ad in my swift application and it simply doesn't show up. I extended the plist to the following.
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-???</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
...
</array>
Edited AppDelegate.swift...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
GADMobileAds.sharedInstance().start(completionHandler: nil)
return true
}
And implemented the banner in my ViewController...
import UIKit
import GoogleMobileAds
class ViewController: UIViewController {
...
private let banner: GADBannerView = {
let banner = GADBannerView()
banner.adUnitID = "ca-app-pub-???/???"
banner.load(GADRequest())
banner.backgroundColor = .secondarySystemBackground
return banner
}()
override func viewDidLoad() {
super.viewDidLoad()
banner.rootViewController = self
view.addSubview(banner)
...
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
banner.frame = CGRect(x: 0, y: view.frame.size.height-50, width: view.frame.size.width, height: 50)
}
...
}
This code causes the following error and the banner doesn't show up:
2022-02-18 19:12:45.453836+0100 TestApp[70970:5163578] <Google> To get test ads on this device, set:
Objective-C
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = #[ GADSimulatorID ];
Swift
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [ GADSimulatorID ]
2022-02-18 19:12:45.464778+0100 TestApp[70970:5163713] - <Google>[I-ACS025031] AdMob App ID changed. Original, new: (nil), ca-app-pub-???
2022-02-18 19:12:45.520401+0100 TestApp[70970:5163714] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.520411+0100 TestApp[70970:5163713] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.520643+0100 TestApp[70970:5163714] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.520657+0100 TestApp[70970:5163718] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.520824+0100 TestApp[70970:5163714] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.520939+0100 TestApp[70970:5163718] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.522075+0100 TestApp[70970:5163718] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.522129+0100 TestApp[70970:5163718] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.}
2022-02-18 19:12:45.522084+0100 TestApp[70970:5163714] - <Google>[I-ACS023007] Analytics v.81200000 started
2022-02-18 19:12:45.522389+0100 TestApp[70970:5163714] - <Google>[I-ACS023008] To enable debug logging set the following application argument: -APMAnalyticsDebugEnabled (see xxx)
2022-02-18 19:12:45.552092+0100 TestApp[70970:5163578] Writing analzed variants.
2022-02-18 19:12:45.588346+0100 TestApp[70970:5163718] - <Google>[I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2022-02-18 19:12:45.616229+0100 TestApp[70970:5163578] Writing analzed variants.
2022-02-18 19:12:45.636629+0100 TestApp[70970:5163578] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000178d2c0> F8BB1C28-BAE8-???
2022-02-18 19:12:45.692429+0100 TestApp[70970:5163721] - <Google>[I-ACS023012] Analytics collection enabled
2022-02-18 19:12:45.912031+0100 TestApp[70970:5163717] [boringssl] boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics
Initialisation of GADBannerView is might be wrong in your project as they need adSize as frame
this working fine on my application , I have working production ads,
class HomePageViewController: UIViewController {
private var adMobBannerView1: GADBannerView!
private var adMobBannerView2: GADBannerView!
override func viewDidLoad() {
setupAdMobBannerAD()
}
private func setupAdMobBannerAD() {
let sizeForBanner = GADAdSizeFromCGSize(.init(width: view.frame.width, height: 50))
// here you need to intilise GADBannerView with adSize of GADAdSizeFromCGSize
adMobBannerView1 = GADBannerView(adSize: sizeForBanner)
adMobBannerView2 = GADBannerView(adSize: sizeForBanner)
adMobBannerView1.translatesAutoresizingMaskIntoConstraints = false
adMobBannerView2.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(adMobBannerView1)
view.addSubview(adMobBannerView2)
adMobBannerView1.delegate = self
adMobBannerView2.delegate = self
NSLayoutConstraint.activate([
adMobBannerView1.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
adMobBannerView1.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor),
adMobBannerView2.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor , constant: 20 ),
adMobBannerView2.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor),
])
adMobBannerView2.adUnitID = Constants.secondAdBannerString
// I have saved my bannerID String in another class don't worry about this
adMobBannerView2.rootViewController = self
adMobBannerView1.adUnitID = Constants.firstAdBannerString
// I have saved my bannerID String in another class don't worry about this
adMobBannerView1.rootViewController = self
adMobBannerView2.load(GADRequest())
adMobBannerView1.load(GADRequest())
}
}
you want to add some delegate to get informed by admob if there is any problem with your ad account or something
extension HomePageViewController : GADBannerViewDelegate {
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("admob banner ad failecd to show going to represent adolony \n")
if DataModel.shared.showAdmobAd {
self.requestAdColonyBanners()
// any alternative method can be performed here as we this function will be called by admob incase you didn't get banner ad , in my case I m launching ads form another ad service called adcolony
}
}
}

Emulator gives failure response: Trust anchor for certification path not found

I tried to search for this error a lot did not found any solution for it.
Details:
Made a request to API through retrofit, getting success response for the real devices but getting failure response if request is been made from android emulator.
public void loadPostsToDB() {
Call<List<Post>> call = mAPIServiceInterface.getAllPosts();
call.enqueue(new Callback<List<Post>>() {
#Override
public void onResponse(Call<List<Post>> call, Response<List<Post>> response) {
List<Post> posts = response.body();
new InsertPostAsyncTask(mDaoInterface,posts).execute();
}
#Override
public void onFailure(Call<List<Post>> call, Throwable t) {
Log.e("Failure Reason : "," "+t.toString());
}
});
}
In above code gives response, I checked through debugging, as per it, point hits on success when ran from real device but failure function debug point got hit if ran from emulator.
Below is the log which got printed.
2020-12-01 20:57:23.647 6863-6879/reference.module.retrofit D/OkHttp: --> GET https://jsonplaceholder.typicode.com/posts
2020-12-01 20:57:23.647 6863-6879/reference.module.retrofit D/OkHttp: --> END GET
2020-12-01 20:57:23.828 6863-6882/reference.module.retrofit I/OpenGLRenderer: Initialized EGL, version 1.4
2020-12-01 20:57:23.828 6863-6882/reference.module.retrofit D/OpenGLRenderer: Swap behavior 1
2020-12-01 20:57:23.829 6863-6882/reference.module.retrofit W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2020-12-01 20:57:23.829 6863-6882/reference.module.retrofit D/OpenGLRenderer: Swap behavior 0
2020-12-01 20:57:23.849 6863-6882/reference.module.retrofit D/EGL_emulation: eglCreateContext: 0x9ca04240: maj 2 min 0 rcv 2
2020-12-01 20:57:23.924 6863-6882/reference.module.retrofit D/EGL_emulation: eglMakeCurrent: 0x9ca04240: ver 2 0 (tinfo 0x9ca037d0)
2020-12-01 20:57:24.135 6863-6882/reference.module.retrofit D/EGL_emulation: eglMakeCurrent: 0x9ca04240: ver 2 0 (tinfo 0x9ca037d0)
2020-12-01 20:57:24.278 6863-6879/reference.module.retrofit D/OkHttp: <-- HTTP FAILED: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
2020-12-01 20:57:24.279 6863-6863/reference.module.retrofit E/Failure Reason :: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Any suggestion? what might be causing this behaviour?
The issue got solved,
It was required change from server side for certificates.

pyspark foreach/foreachPartition send http request failed

I use urllib.request to send http request in foreach/foreachPartition. pyspark throw error as follow:
objc[74094]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
20/07/20 19:05:58 ERROR Executor: Exception in task 7.0 in stage 0.0 (TID 7)
org.apache.spark.SparkException: Python worker exited unexpectedly (crashed)
at org.apache.spark.api.python.BasePythonRunner$ReaderIterator$$anonfun$1.applyOrElse(PythonRunner.scala:536)
at org.apache.spark.api.python.BasePythonRunner$ReaderIterator$$anonfun$1.applyOrElse(PythonRunner.scala:525)
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
at org.apache.spark.api.python.PythonRunner$$anon$3.read(PythonRunner.scala:643)
at org.apache.spark.api.python.PythonRunner$$anon$3.read(PythonRunner.scala:621)
at org.apache.spark.api.python.BasePythonRunner$ReaderIterator.hasNext(PythonRunner.scala:456)
at org.apache.spark.InterruptibleIterator.hasNext(InterruptibleIterator.scala:37)
at scala.collection.Iterator.foreach(Iterator.scala:941)
at scala.collection.Iterator.foreach$(Iterator.scala:941)
at org.apache.spark.InterruptibleIterator.foreach(InterruptibleIterator.scala:28)
at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:62)
at scala.collection.generic.Growable.$plus$plus$eq$(Growable.scala:53)
at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:105)
at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:49)
at scala.collection.TraversableOnce.to(TraversableOnce.scala:315)
at scala.collection.TraversableOnce.to$(TraversableOnce.scala:313)
at org.apache.spark.InterruptibleIterator.to(InterruptibleIterator.scala:28)
at scala.collection.TraversableOnce.toBuffer(TraversableOnce.scala:307)
at scala.collection.TraversableOnce.toBuffer$(TraversableOnce.scala:307)
at org.apache.spark.InterruptibleIterator.toBuffer(InterruptibleIterator.scala:28)
at scala.collection.TraversableOnce.toArray(TraversableOnce.scala:294)
at scala.collection.TraversableOnce.toArray$(TraversableOnce.scala:288)
at org.apache.spark.InterruptibleIterator.toArray(InterruptibleIterator.scala:28)
at org.apache.spark.rdd.RDD.$anonfun$collect$2(RDD.scala:1004)
at org.apache.spark.SparkContext.$anonfun$runJob$5(SparkContext.scala:2133)
_
when i call rdd.foreach(send_http), rdd=sc.parallelize(["http://192.168.1.1:5000/index.html"]),
send_http defined as follow:
def send_http(url):
req = urllib.request.Request(url)
resp = urllib.request.urlopen(req)
anyone can tell me the problem? thanks.
This is #tmylt's answer in the comment above, but I too can confirm that using http.client instead of requests.get does work. I'm sure there's a reason why this is happening, but using python http.client is a quick fix.

Swift: opening the connection to server using CFStreamCreatePairWithSocketToHost function failed how do I fix it?

I want so send a message to the localhost on port number 80 but I was able to open a connection What did i do wrong and how can I fix it?
Here is the code to connect to the localhost server
class client:NSObject {
var inputstream = InputStream!
var outputstream = OutputStream!
func setupNetworkCom() {
var readstream = Unmanaged<CFReadStream>?
var writestream = Unmanaged<CFWriteStream>?
CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, "localhost" as CFString, 80, &readstream, &writestream)
inputstream = readstream!.takeRetainedValue()
outputstream = writestream!.takeReatainedValue()
inputstream.schedule(in: .current, forMode: .common)
outputstream.schedule(in: .current, forMode: .common)
inputstream.open()
outputstream.open()
}
}
It gives me this error
2020-02-25 17:32:49.388120+0530 Test[3800:171412] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
2020-02-25 17:32:50.389186+0530 Test[3800:171412] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
2020-02-25 17:32:51.389589+0530 Test[3800:171412] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
2020-02-25 17:32:52.392031+0530 Test[3800:171412] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:5 Err:-1 Errno:1 Operation not permitted
2020-02-25 17:32:52.392319+0530 Test[3800:171412] [] nw_resolver_create_dns_service_locked DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2020-02-25 17:32:52.392724+0530 Test[3800:171411] [] nw_connection_get_connected_socket 1 Connection has no connected handler
2020-02-25 17:32:52.392754+0530 Test[3800:171411] TCP Conn 0x600000163a80 Failed : error 0:-65563 [-65563]
I downloaded the server from this tutorial https://www.raywenderlich.com/3437391-real-time-communication-with-streams-tutorial-for-ios#toc-anchor-010
This question and your Other question have the same answer you're missing the entitlement in the capabilities tab.
click on your project settings and go to capabilities there you'll see the app sandbox. make sure it's turned on and then enable incoming connections and outgoing connections.

Mac OS AVPlayer Xcode 10.2.1 swift 5.0.1 won't work

I am trying to create a simple AVBasicPlayBack for Mac OS 10.14.5 Xcode 10.2.1 swift 5.0.1. I used AVPlayer it is throwing some errors. New to Mac OS Development could not figure out what is wrong. I have checked lots of documentation online.
I added NSAppTransportSecurity to info.plist file shown below.
info.plist file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Personal. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>devimages-cdn.apple.com</key>
<dict/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
ViewController.swift
import Cocoa
import AVKit
class ViewController: NSViewController {
#IBOutlet weak var playerView: AVPlayerView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
guard let url = URL(string: "https://devimages-cdn.apple.com/samplecode/avfoundationMedia/AVFoundationQueuePlayer_HLS2/master.m3u8")
else {
return
}
// Create a new AVPlayer and associate it with the player view
//let player = AVPlayer(url: url)
//playerView.player = player
let avAsset = AVURLAsset(url: url, options: nil)
let playerItem = AVPlayerItem(asset: avAsset)
let videoPlayer = AVPlayer(playerItem: playerItem)
playerView.player = videoPlayer
videoPlayer.play()
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}
I get the following errors
2019-06-23 14:03:10.958123-0700 AVBasicPlayback[27278:6522581] [] nw_dictionary_set_value called with null dictionary
2019-06-23 14:03:10.958154-0700 AVBasicPlayback[27278:6522581] [] __nwlog_err_simulate_crash simulate crash failed "nw_dictionary_set_value called with null dictionary"
2019-06-23 14:03:10.958334-0700 AVBasicPlayback[27278:6522581] [] nw_dictionary_set_value called with null dictionary, dumping backtrace:
[x86_64] libnetcore-1229.250.15
0 libnetwork.dylib 0x00007fff747f8c88 __nw_create_backtrace_string + 120
1 libnetwork.dylib 0x00007fff7454cb09 nw_dictionary_set_value + 265
2 libnetwork.dylib 0x00007fff745e5bce nw_path_evaluator_cancel + 654
3 MediaToolbox 0x00007fff4e8ca975 FigMetadataReaderCreateForBoxedMetadata + 10998
4 MediaToolbox 0x00007fff4ea170f3 FigBytePumpCreateForHTTPChunk + 73903
5 MediaToolbox 0x00007fff4ea06752 FigBytePumpCreateForHTTPChunk + 5902
6 libdispatch.dylib 0x000000010034bf1b _dispatch_client_callout + 8
7 libdispatch.dylib 0x0000000100354067 _dispatch_lane_serial_drain + 773
8 libdispatch.dylib 0x0000000100354f4e _dispatch_lane_invoke + 493
9 libdispatch.dylib 0x000000010035e824 _dispatch_root_queue_drain + 334
10 libdispatch.dylib 0x000000010035e60b _dispatch_worker_thread + 271
11 libsystem_pthread.dylib 0x00000001003c5dc3 _pthread_body + 126
12 libsystem_pthread.dylib 0x00000001003c8e8d _pthread_start + 66
13 libsystem_pthread.dylib 0x00000001003c4e11 thread_start + 13
2019-06-23 14:03:10.964828-0700 AVBasicPlayback[27278:6522533] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}
2019-06-23 14:03:10.973122-0700 AVBasicPlayback[27278:6522533] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}
2019-06-23 14:03:10.982169-0700 AVBasicPlayback[27278:6522553] Received XPC error Connection invalid for message type 3 kCFNetworkAgentXPCMessageTypePACQuery
2019-06-23 14:03:10.982216-0700 AVBasicPlayback[27278:6522553] PAC result block not invoked
2019-06-23 14:03:10.982273-0700 AVBasicPlayback[27278:6522553] [] nw_proxy_resolver_create_parsed_array PAC evaluation error: kCFErrorDomainCFNetwork: 308
2019-06-23 14:03:10.984342-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
2019-06-23 14:03:11.988908-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
2019-06-23 14:03:12.990000-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
2019-06-23 14:03:13.995302-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted
2019-06-23 14:03:13.996203-0700 AVBasicPlayback[27278:6522553] [] nw_resolver_create_dns_service_locked [C1.1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2019-06-23 14:03:13.997244-0700 AVBasicPlayback[27278:6522553] TIC TCP Conn Failed [1:0x600003716280]: 10:-72000 Err(-65563)
2019-06-23 14:03:13.998574-0700 AVBasicPlayback[27278:6522520] Task <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1> HTTP load failed (error code: -1003 [10:-72000])
2019-06-23 14:03:13.998782-0700 AVBasicPlayback[27278:6522520] Task <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1> finished with error - code: -1003
2019-06-23 14:03:14.005116-0700 AVBasicPlayback[27278:6522581] Task <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={_kCFStreamErrorCodeKey=-72000, NSUnderlyingError=0x600000cdc270 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://devimages-cdn.apple.com/samplecode/avfoundationMedia/AVFoundationQueuePlayer_HLS2/master.m3u8, NSErrorFailingURLKey=https://devimages-cdn.apple.com/samplecode/avfoundationMedia/AVFoundationQueuePlayer_HLS2/master.m3u8, _kCFStreamErrorDomainKey=10} [-1003]
2019-06-23 14:03:14.007457-0700 AVBasicPlayback[27278:6522520] sendMessageWithDictionary: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}
Select "Outgoing Connections (Client)" checkbox in "App Capabilities". This started displaying video but still some errors. I will update answer after I find solution for the remaining errors. Errors are regarding XPC.