I am creating a radio application. After the application has passed the splash screen, the screen outside the bottom bar turns red.
I think it is from http
2022-10-27 14:07:00.368656+0300 Runner[62716:427809] Connection 2: received failure notification
2022-10-27 14:07:00.368867+0300 Runner[62716:427809] Connection 2: failed to connect 1:60, reason -1
2022-10-27 14:07:00.369029+0300 Runner[62716:427809] Connection 2: encountered error(1:60)
2022-10-27 14:07:00.370267+0300 Runner[62716:427809] Task <A8DDE404-0AF3-486C-BB5A-98B2534EEAA9>.<1> HTTP load failed, 0/0 bytes (error code: -1001 [1:60])
2022-10-27 14:07:00.373687+0300 Runner[62716:427148] Task <A8DDE404-0AF3-486C-BB5A-98B2534EEAA9>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=60, NSUnderlyingError=0x600001c3ebe0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0, _kCFStreamErrorCodeKey=60, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <A8DDE404-0AF3-486C-BB5A-98B2534EEAA9>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <A8DDE404-0AF3-486C-BB5A-98B2534EEAA9>.<1>"
), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://xxxxxxxxxxxxxxxx, NSErrorFailingURLKey=xxxxxxxxxxxxxxxxx, _kCFStreamErrorDomainKey=1}
"playback failed"
2022-10-27 14:07:00.391374+0300 Runner[62716:427174] flutter: PlatformException(PLAY_ERROR, Cannot play https://xxxxxxxxxxxxxxxxx, The request timed out., null)
2022-10-27 14:07:00.393303+0300 Runner[62716:427174] [VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: PlatformException(PLAY_ERROR, Cannot play xxxxxxxxxxxxxxxxx, The request timed out., null)
HTTP load failed, 0/0 bytes (error code: -1001 [1:60])
Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Related
I am getting error from last 2 days
Task <4098D1A9-4E3A-4A42-A381-3660F15CCD98>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=60, NSUnderlyingError=0x2813fb780 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: en0, ipv4, dns, _kCFStreamErrorCodeKey=60, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <4098D1A9-4E3A-4A42-A381-3660F15CCD98>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
),
NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://oauth2.googleapis.com/token, NSErrorFailingURLKey=https://oauth2.googleapis.com/token, _kCFStreamErrorDomainKey=1}
Previously its working fine what was the cause?
Xcode 12.2,
Alamofire 5.4.0,
Swift 5
I have this snippet of code to request data from a backend which works fine in the happy flow.
But if for some reason the backend is unreachable, I see autogenerated logging I want it to hide or silence. Because it's disturbing me when I'm analysing debug logging.
let request = AF.request("http://192.168.1.5:44444/api/users", headers: headers)
request.responseJSON { (data) in
switch data.result {
case .success:
print("Request Succes!")
case .failure(let errorData):
print("Request Failed")
print("\(errorData.errorDescription ?? "")")
}
}
Error output:
Task <xxxxxxxx>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
Task <xxxxxxxx>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600000d82250 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <xxxxxxxxx>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <xxxxxxxxx>.<1>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://192.168.1.5:44444/developer, NSErrorFailingURLKey=http://192.168.1.5:44444/developer, _kCFStreamErrorDomainKey=1}
Request Failed
URLSessionTask failed with error: Could not connect to the server.
I want to get rid of the following, which is not generated by me:
Task <xxxxxxxx>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
Task <xxxxxxxx>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600000d82250 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <xxxxxxxxx>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <xxxxxxxxx>.<1>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://192.168.1.5:44444/developer, NSErrorFailingURLKey=http://192.168.1.5:44444/developer, _kCFStreamErrorDomainKey=1}
and see only:
Request Failed
URLSessionTask failed with error: Could not connect to the server.
These are system logs produced by the OS, not Alamofire. While you can silence them by disabling the os subsystem, I don't recommend it, as that disables all os_logs in your app and other os module functionality, like signposts. A feature request to Apple using Feedback Assistant may eventually convince them to let us filter these in Xcode.
I had exactly the same issue, I want to only the the debug entries created by me and not the ones by the system. I solved this using a prefix for all my own log entries. For example "[sync] Synchronizing from server..." or "[sync] Couldn't connect to server.".
Now you can set the filter in XCode (at the bottom of the log pane) to the prefix "[sync]" and you only see your own entries. This even works while running the app and the logs come in!
I encountered a weird problem trying to connect with firebase in my project. I already followed all necessary steps - firebase config, cocopod, google.plist - but I keep getting these error messages in this screenshot. Does anyone else encounter this problem and how did you resolve it?
Sceenshot
AppDelegate
import UIKit
import Firebase
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
Console
2020-10-25 10:47:24.604330-0400 test2[2991:35955] Connection 1: received failure notification
2020-10-25 10:47:24.604477-0400 test2[2991:35955] Connection 1: failed to connect 1:61, reason -1
2020-10-25 10:47:24.604584-0400 test2[2991:35955] Connection 1: encountered error(1:61)
2020-10-25 10:47:24.609628-0400 test2[2991:35955] Task <EF95DB6A-2445-4E58-9B2F-AFA35EE0A68E>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
2020-10-25 10:47:24.616313-0400 test2[2991:35955] Task <EF95DB6A-2445-4E58-9B2F-AFA35EE0A68E>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x600001748c90 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog, NSErrorFailingURLKey=https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
2020-10-25 10:47:24.645716-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60900000 started
2020-10-25 10:47:24.649697-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/)
2020-10-25 10:47:24.651125-0400 test2[2991:35955] 6.34.0 - [Firebase/Analytics][I-ACS023171] Resetting App Measurement data
2020-10-25 10:47:24.752809-0400 test2[2991:35975] 6.34.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2020-10-25 10:47:24.788481-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
2020-10-25 10:47:24.789629-0400 test2[2991:35949] 6.34.0 - [Firebase/Analytics][I-ACS023220] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist
2020-10-25 10:47:39.183384-0400 test2[2991:36053] [] nw_socket_handle_socket_event [C3.1:3] Socket SO_ERROR [61: Connection refused]
2020-10-25 10:47:39.183765-0400 test2[2991:36053] [BoringSSL] nw_protocol_boringssl_handshake_negotiate_proceed(726) [0x7fd4bee004a0] handshake failed at state 0
2020-10-25 10:47:39.185931-0400 test2[2991:36053] Connection 3: received failure notification
2020-10-25 10:47:39.186090-0400 test2[2991:36053] Connection 3: failed to connect 1:61, reason -1
2020-10-25 10:47:39.186224-0400 test2[2991:36053] Connection 3: encountered error(1:61)
2020-10-25 10:47:39.190919-0400 test2[2991:36053] Task <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
2020-10-25 10:47:39.192171-0400 test2[2991:35790] Task <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600001732970 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>"), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, NSErrorFailingURLKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, _kCFStreamErrorDomainKey=1}
2020-10-25 10:47:39.194966-0400 test2[2991:36054] 6.34.0 - [Firebase/Analytics][I-ACS901017] Encounter network error. Code, error: -1004, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600001732970 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>"), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, NSErrorFailingURLKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, _kCFStreamErrorDomainKey=1}
2020-10-25 10:47:39.197349-0400 test2[2991:36054] 6.34.0 - [Firebase/Analytics][I-ACS023128] Network request failed to fetch remote config. Code, Error: 0, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600001732970 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>"), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, NSErrorFailingURLKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, _kCFStreamErrorDomainKey=1}
2020-10-25 10:47:39.198538-0400 test2[2991:36054] 6.34.0 - [Firebase/Analytics][I-ACS023129] Network fetch failed. Will retry later. Code, error: 0, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600001732970 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDownloadTask <69F833DC-E03D-46E7-A72D-DE7246C8BDFF>.<1>"), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, NSErrorFailingURLKey=https://app-measurement.com/config/app/1:955410733527:ios:c82bc7afb517ae10479392?platform=ios&app_instance_id=3A4D3A72AC624838AB769B6871063F58&gmp_version=60900, _kCFStreamErrorDomainKey=1}
1- I think everything is going well but it's appearing in the error that you may have a poor connection " Could not connect to the server "
My advice is to try it again and make sure from google Plist that it's documented under the same bundle identifier
2- If the previous doesn't work, just try to update the pod
3- In the worst case try to uninstall it & install it again
Steps to reproduce:
Create a new app and call any API to the server to get data
immediately take the app to background
network get disconnects
below is the log:
2020-03-26 17:21:00.894598+0530 TestApp[783:152843] Connection 2: received failure notification
2020-03-26 17:21:00.895805+0530 TestApp[783:152843] Connection 2: failed to connect 1:53, reason -1
2020-03-26 17:21:00.895895+0530 TestApp[783:152843] Connection 2: encountered error(1:53)
2020-03-26 17:21:00.901375+0530 TestApp[783:152843] Task <36B9553A-99F2-42FE-8650-A5E5155EFCFD>.<1> HTTP load failed, 0/0 bytes (error code: -1005 [1:53])
2020-03-26 17:21:00.901831+0530 TestApp[783:152843] Connection 1: received failure notification
2020-03-26 17:21:00.902078+0530 TestApp[783:152843] [] nw_flow_add_write_request [C1.1 40.85.185.46:443 failed channel-flow (satisfied (Path is satisfied), interface: en0, ipv4, dns)] cannot accept write requests
2020-03-26 17:21:00.902200+0530 TestApp[783:152843] [] nw_write_request_report [C1] Send failed with error "Socket is not connected"
2020-03-26 17:21:00.905902+0530 TestApp[783:152870] Task <36B9553A-99F2-42FE-8650-A5E5155EFCFD>.<1> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x2824734e0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://api.server.account, NSErrorFailingURLKey=https://api.server.account, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=53, NSLocalizedDescription=The network connection was lost.}
I'm trying to create a streaming app on iOS. So at first I tried with an http url and it didn't work because of security reasons they say so I created an https server on Android using NanoHTTPD and I'm able to access the new https server with Android and Windows devices connected on the same network albeit with warnings. Now I added this on my Info.plist file
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
But it still remains the same and then I ran the app on the simulator and the logs gave me this
2019-09-21 15:40:07.540419+0800 SampleAVPlayerStream[8746:47938] 80: Failed to set processVolumeScalar on device. Error: 560947818
2019-09-21 15:40:07.859455+0800 SampleAVPlayerStream[8746:47938] TIC SSL Trust Error [1:0x6000017fb480]: 3:0
2019-09-21 15:40:07.877511+0800 SampleAVPlayerStream[8746:47938] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2019-09-21 15:40:07.881312+0800 SampleAVPlayerStream[8746:47938] Task <8F036D25-D6CC-433E-A61E-CD5A844CFAF5>.<1> HTTP load failed (error code: -1202 [3:-9813])
2019-09-21 15:40:07.886919+0800 SampleAVPlayerStream[8746:47938] Task <8F036D25-D6CC-433E-A61E-CD5A844CFAF5>.<1> finished with error - code: -1202
2019-09-21 15:40:07.900192+0800 SampleAVPlayerStream[8746:48024] Task <8F036D25-D6CC-433E-A61E-CD5A844CFAF5>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “192.168.0.27” which could put your confidential information at risk." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=(
"<cert(0x7fc32a084600) s: Gus Fakelastname i: Gus Fakelastname>"
), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://192.168.0.27:8080/Videos/heyheyhey.mp4, NSErrorFailingURLStringKey=https://192.168.0.27:8080/Videos/heyheyhey.mp4, NSUnderlyingError=0x600002c9c4b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x6000010e8750>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9813, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9813, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x7fc32a084600) s: Gus Fakelastname i: Gus Fakelastname>"
)}}, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <8F036D25-D6CC-433E-A61E-CD5A844CFAF5>.<1>"
), _kCFStreamErrorCodeKey=-9813, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <8F036D25-D6CC-433E-A61E-CD5A844CFAF5>.<1>, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x6000010e8750>, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “192.168.0.27” which could put your confidential information at risk.} [-1202]
Update: This is the logs if I revert the server back to http
2019-09-21 19:12:37.829817+0800 SampleAVPlayerStream[4270:23381] Task <D17E6DB2-73F5-4C8D-92B7-A10B0EECD8BD>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=http://192.168.0.27:8080/Videos/heyheyhey.mp4, NSErrorFailingURLKey=http://192.168.0.27:8080/Videos/heyheyhey.mp4, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <D17E6DB2-73F5-4C8D-92B7-A10B0EECD8BD>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <D17E6DB2-73F5-4C8D-92B7-A10B0EECD8BD>.<1>, NSLocalizedDescription=cancelled} [-999]
2019-09-21 19:12:37.826346+0800 SampleAVPlayerStream[4270:23254] Task <D17E6DB2-73F5-4C8D-92B7-A10B0EECD8BD>.<1> finished with error - code: -999
Here is the Swift code.
if let urlVal = NSURL(string: "https://192.168.0.27:8080/Videos/heyheyhey.mp4") {
let player = AVPlayer(url: urlVal as URL);
let vc = AVPlayerViewController();
vc.player = player;
present(vc, animated: true) {
vc.player?.play();
}
}