위치 관리자 오류 : (KCLErrorDomain 오류 0)
Location Manager Error : Operation could not be completed(KCLErrorDomain error 0)
이 오류가 발생하는 이유는 무엇입니까?
이 오류는 Scheme/Edit Scheme/Options/Allow Location Simulation
선택했지만 기본 위치가 설정되지 않은 경우 발생합니다 . 나는 다른 원인도 있다고 확신합니다.
최신 정보
Ben Marten 에게 감사드립니다 XCode에서 다음 단계를 사용하여 영구적으로 만들 수 있습니다.
- 제품> 구성> 구성 편집
- .app 실행을 클릭합니다.
- 옵션 탭
- 이미 확인한 핵심 위치> 위치 선택
- 확인을 누릅니다.
또한 Wi-Fi에 연결되어 있지 않아도 상위 메뉴 항목을 통해 시뮬레이터에서 위치를 설정하고 Debug>Location
위의 단계를 따라 영구적으로 만들 수 있습니다.
방금이 문제가 발생했습니다. 해결책을 찾는 데 시간이 걸렸습니다. 이전 포스터의 답변과 느슨하게 관련이 있습니다.
Airport (WiFi) must be on for CoreLocation in the iPhone/iPad Simulator to work. I was connected via Ethernet so CL didn't do anything in the Simulator. Turn on Airport in your Network Settings and try again. You can change the order of your network interfaces by dragging Airport below Ethernet if you want to continue favoring your wired connection over your wireless...
From the API docs:
CLError
Error codes returned by the location manager object.
typedef enum { kCLErrorLocationUnknown = 0, kCLErrorDenied, kCLErrorNetwork, kCLErrorHeadingFailure } CLError;
Constants
kCLErrorLocationUnknown The location manager was unable to obtain a location value right now.Available in iPhone OS 2.0 and later. Declared in CLError.h.
kCLErrorDenied Access to the location service was denied by the user. Available in iPhone OS 2.0 and later. Declared in CLError.h.
kCLErrorNetwork The network was unavailable or a network error occurred. Available in iPhone OS 3.0b and later. Declared in CLError.h.
kCLErrorHeadingFailure The heading could not be determined. Available in iPhone OS 3.0 and later. Declared in CLError.h.
So this means the location could not be determined.
I would guess the most likely cause is that the location manager is using WiFi to triangulate the location, and the database doesn't cover the local networks. That apparently can be fixed by the user if they go here.
However as I noted I have also seen this occasionally as a transient error when running a location based program in a location where the WiFi location stuff normally works.
Lastly I guess it is possible to see this error if there is some kind of hardware failure.
1) check that you actually have a valid WiFi and 3G connection
if you do then
2) go to settings and reset your location services 3) reset your network settings
This error is thrown when Location Manager is unable to get location information immediately. I found that this error was occurring when startUpdatingLocation method was called. For me, this was happening on iPod but not on iPhone. That makes sense, since, iPhone has more ways (like cellular network) to get location information and is able get a quick estimate on the location whereas iPod takes more time which caused this error to be raised on iPod.
Since, when this error is thrown locationManager:didFailWithError: delegate method is called, one can handle this specific case in a conditional statement by matching "[error domain]" and "[error code]" from the error object passed to this method.
The exact reason what I have found is there is a conflict occuring in the location simulation in both the ios simulator “Debug settings” and in the xcode settings “Edit schemes”.Ensure to set you default user location in any one of this and mark the other to None solved the problem hope this might help for sure. InXcode:
In iphone/ipad simulator:
You can add your own list of locations to Xcode to test your applications with.
From within Xcode select the menu Debug/Simulate Location and you'll be offered:
a. "Don't Simulate Location"
b. 12 example locations
c. "Add GPX File to Project..."
Select "Add GPX File to Project..." and select the GPX file you've created.
This error occur while you run your program ,but you simulate location after you run the programe.
I get a method :quit your simulator and restart it ,then set your simulator location before you run the programe,and it works for me .
Hope this helps! It certainly helped me. thanks...
If you got this in Emulator then do following
Debug > Location > ✓ Apple
Go to Xcode project >product>scheme>edit scheme>chek location simulation>set your location> and run app again Hope it will works !
Thanks to this article (https://possiblemobile.com/2013/04/using-xcode-to-test-location-services/) I got a hint to look at the data on my custom GPX file and there found the issue.
Some GPX files you might get from different sources might have the following elements indicating the different coordinates in specified path. This wont work with Xcode's Location Simulation.
<gpx>
...
<trkpt lat="" lon="">
<ele></ele>
</trkpt>
...
</gpx>
What you should do is find all occurrences of the "trkpt" element and replace it with "wpt" in your favorite text/xml editor. The end result should be something as follows:
<gpx>
<wpt lat="" lon="">
<ele></ele>
</wpt>
...
</gpx>
Hope this helps! It certainly helped me.
all of this didn't work for me.. what worked for me is :- set the location from the simulator to none
then change it back to custom
location while the app is running.
All of the suggestions didn't help in my case. What helped was to uninstall the app from the simulator device, reinstall it and allow it to access the location (in the settings app).
기기에서이 정보를 얻는다면 요청하지 않았거나 사용자가 위치 수집 권한을 거부했을 가능성이 있습니다.
참고 URL : https://stackoverflow.com/questions/1409141/location-manager-error-kclerrordomain-error-0
'Programing' 카테고리의 다른 글
Kubernetes에서 컨테이너를 계속 실행하려면 어떻게해야합니까? (0) | 2020.09.08 |
---|---|
127.0.0.1:6379에서 Redis에 연결할 수 없음 : 홈브류로 연결이 거부되었습니다. (0) | 2020.09.08 |
절대 위치 Div의 중앙 정렬 (0) | 2020.09.08 |
Stateless 및 Stateful Enterprise Java Bean (0) | 2020.09.08 |
ipython 노트북 출력 창 크기 조정 (0) | 2020.09.08 |