i'm trying to use google maps in my app, i followed there main steps here: https://developers.google.com/maps/documentation/ios/start#getting_the_google_maps_sdk_for_ios
the sceene was loaded, but the map is empty, and i got this error :
ClientParametersRequest failed, 0 attempts remaining (0 vs 6). Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo=0x7fd8ab5e9680 {NSUnderlyingError=0x7fd8b0201c40 "The network connection was lost.", NSErrorFailingURLStringKey=https://clients4.google.com/glm/mmap, NSErrorFailingURLKey=https://clients4.google.com/glm/mmap, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=57, NSLocalizedDescription=The network connection was lost.
anyone knows what's the problem ?
Try reseting the iOS simulator:
iOS Simulator -> Reset Content and Settings
Related
Generally, while performing GET or POST calls in iOS using dataTaskWithRequest or sendAsynchronousRequest we use to face network related errors with error codes like,
NSURLErrorNotConnectedToInternet = -1009
NSURLErrorCannotConnectToHost = -1004
NSURLErrorTimedOut = -1001
In my case i'm disconnecting the internet and performing service calls. So, the expected error code is "NSURLErrorNotConnectedToInternet = -1009". But, its throwing "NSURLErrorCannotConnectToHost = -1004" like below,
Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the
server." UserInfo=0x1700f0e00 {NSUnderlyingError=0x170255e70 "The
operation couldn’t be completed. (kCFErrorDomainCFNetwork error
-1004.)", NSErrorFailingURLStringKey=https://example.com/reg,
NSErrorFailingURLKey=https://example.com/reg, _kCFStreamErrorDomainKey=1,
_kCFStreamErrorCodeKey=51, NSLocalizedDescription=Could not connect to the server.}
So, how to get the exact error status while using dataTaskWithRequest or sendAsynchronousRequest.
As a rule, IIRC, the OS sends "not connected to Internet" only in two situations:
The network is determined to be nonfunctional after:
One or more URL requests fail and
The OS tries to probe a well-known captive-portal-detection URL and
That request also fails
No interface has an IP address
Including any connected VPNs
Excluding loopback interface
Up until the system reaches that state, the failures you see will be "cannot connect to host", because that's all the OS knows for certain.
As a rule, your app should interpret these in the same way — by using reachability to determine when to try again, then trying again when reachability changes.
I am using AfNetworking 1.0 into my app.I have created a singleton class of AFHTTP Client.
So all the API's are place in the same class.
I am getting a very wierd issue.
For eg: Let say, i have requested for some data from server.But the internet connection has lost.
So the failure block get's called.
m getting the following error:
Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x797dcc70 {NSErrorFailingURLStringKey=https://testing.com?searchText=s&pageSize=10&pageNumber=5, _kCFStreamErrorCodeKey=57, NSErrorFailingURLKey=https://testing.com?searchText=s&pageSize=10&pageNumber=5, NSLocalizedDescription=The Internet connection appears to be offline., _kCFStreamErrorDomainKey=1, NSUnderlyingError=0x7aa367e0 "The Internet connection appears to be offline."}
But if i try to get the status code using following code:
NSLog(#"Status code %d",[operation.response statusCode]);
m getting Status Code as "0".
Can you please explain,why i am getting Status code as "0"?
I have to handle the error,depends on HTTP Status Code.So what is the best way to get this done?
(the same way which i am doing or is there any other way.)
In this case you can't use the status code because there isn't one. The status code comes from the server and in this case the client has not been able to contact the server.
You should use the error domain and code to handle this case.
I'm using Parse.com SDK.
my internet connection is OK and reset the emulator not help.
And for some reason, from yesterday i see this message every time the app load:
2014-11-25 10:00:32.275 myApp[6551:952636] Error: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo=0x78f3b6f0 {NSErrorFailingURLStringKey=https://api.parse.com/2/client_events, _kCFStreamErrorCodeKey=57, NSErrorFailingURLKey=https://api.parse.com/2/client_events, NSLocalizedDescription=The network connection was lost., _kCFStreamErrorDomainKey=1, NSUnderlyingError=0x78f3ad40 "The network connection was lost."} (Code: 100, Version: 1.4.0)
2014-11-25 10:00:32.275 myApp[6551:952637] Attempt at runEventually command timed out. Waiting 600.000000 seconds. 5 retries remaining.
I suggest you to first subscribe parse status mail list from here.
Check your api number.
Reset simulator and close open xcode.
If you reset simulator, problem could be from api keys or parse.
I have an iPhone application in which I have a request which works fine on wifi and with all network carriages but one carriage. On this carriage, if I use ASIHttpRequest, it gives me the below error:
ASIHTTPRequest request_didFail: Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0xd54e2f0 {NSUnderlyingError=0xd502de0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)", NSLocalizedDescription=A connection failure occurred}
If I use AFNetworking it returns below error:
NSLocalizedDescription = "Could not connect to the server.";
NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1004 \"Could not connect to the server.\" UserInfo=0xdc98630 {NSErrorFailingURLKey=https://sitename.com, NSErrorFailingURLStringKey=https://sitename.com, NSLocalizedDescription=Could not connect to the server.}";
First of all, what could be the reason of this error assuming it only happens for a specific carrier? Second, as the request works with everything but this carriage, it seems hard to debug, so how can I debug it to find the exact problem?
Thanks
It turned out that the problem was with this specific telco. Without changing the code, it started to work again after some time.
For the answer to this question, I can say that the reason could be about some proxy thing that is made by the telco and we tried to debug it by applying different proxy tests.
I am getting this error code when using 'MKMapView' on the iPhone 4:
Could not determine current country code: Error Domain=GEOErrorDomain Code=-2 "The operation couldn’t be completed. (GEOErrorDomain error -2.)"
The map loads fine with coordinates etc, but this gets logged.
Any ideas what is causing it?
I got this today on my iPad4-Wifi.
Reading more of the message, it stated that it had o internet connection.
Sure enough, the iPad lost connection to the wifi for some reason.
I reselected our wifi network, retried the test and it worked.