Location manager error KCLErrorDomain error 0 - ios

Sometimes I get this error on the device.
I've seen past question on this saying the error will occur if simulation location is enabled in the scheme. However I'm getting this on hardware not the simulator.
Other answer say to check there is Wifi/3G. Which there is.
Other answer say to reset the location services and the network services. However this would imply some terminal fault with the device, but after getting this error I might try again later and it would work.

From Apple Docs,
typedef enum {
kCLErrorLocationUnknown = 0,
kCLErrorDenied,
kCLErrorNetwork,
kCLErrorHeadingFailure,
kCLErrorRegionMonitoringDenied,
kCLErrorRegionMonitoringFailure,
kCLErrorRegionMonitoringSetupDelayed,
kCLErrorRegionMonitoringResponseDelayed,
kCLErrorGeocodeFoundNoResult,
kCLErrorGeocodeFoundPartialResult,
kCLErrorGeocodeCanceled,
kCLErrorDeferredFailed,
kCLErrorDeferredNotUpdatingLocation,
kCLErrorDeferredAccuracyTooLow,
kCLErrorDeferredDistanceFiltered,
kCLErrorDeferredCanceled,
} CLError;
kCLErrorDomain error comes unexpectedly, reason may be different. You are getting the error 0; i.e kCLErrorLocationUnknown the location manager was unable to obtain a location value right now.

Related

AudioSession maximumInputNumberOfChannels returning 0

I made an iOS plugin that captures audio data and forwards it along to a listener in the form of a byte stream. It was working flawlessly in an emulator and on various devices, but on an iPhone 6 running iOS 11.3 it is crashing during initialization. I've tracked the problem to this code:
let session = AVAudioSession.sharedInstance()
do {
try session.setCategory(AVAudioSessionCategoryPlayAndRecord)
try session.setPreferredInputNumberOfChannels(1) // This is the line that is throwing
try session.setPreferredIOBufferDuration(65)
} catch {
print(error.localizedDescription) // Prints: The operation couldn’t be completed. (OSStatus error -50.)
return -1
}
As the comment shows, the error is being caused by the call to session.setPreferredIOBufferDuration. Looking at the documentation, it says that the call will throw if the input number is greater than session.maximumInputNumberOfChannels, and judging from the error message, this seems to be the case. Checking that value on this phone, it is returning 0.
What would be causing that value to be 0? As far as I can tell, I don' think it's a permissions issue, as I request microphone permissions prior to the app reaching this point in the code. The only other thing I can think of is that the phone essentially has no microphone capabilities... but it's a phone, so the inclusion of a microphone seems fairly standard.
EDIT: I pulled out an iPad Air that's running iOS 12, and it's having the same issue.
I found the problem. I needed to add session.setActive(true) before trying to set the number of channels. I've never had to do that before, but I guess it's something you should do anyway just in case.
AVAudioSession.sharedInstance()
you can change it anyway,
search it?

Error handling in Swift AWSPolly

Every example of AWSPolly I can find says:
// Again, we ignore the errors in the example.
For example:
https://github.com/awslabs/aws-sdk-ios-samples/blob/master/Polly-Sample/Swift/PollySample/ViewController.swift
I cannot figure out how to handle the errors. What if internet service drops out and Polly can't be accessed. I'd like to use the internal voice. But I can't figure out.
I checked:
awsTask.isCanceled || awsTask.isFaulted
But neither of them are true if Internet service is not available.

SensorStreamViewer, HoloLensForCV : "Failed to initialized media capture: Access is denied."

I tried to get sensor stream from HoloLens, so I used the HoloLensForCV.
(https://github.com/Microsoft/HoloLensForCV)
First, I checked that SensorStreamViewer project works, but few days later, I updated HoloLens and then it doesn't work. The error I receive is Access is Denied
HoloLens Camera view capture
HoloLens Privacy Camera capture
The Webcam capability in VS capture
And, I guess the error occurs in this part(SensorStreamViewer.xaml.cpp).
// Initialize MediaCapture with the specified group.
// This must occur on the UI thread because some device families
// (such as Xbox) will prompt the user to grant consent for the
// app to access cameras.
// This can raise an exception if the source no longer exists,
// or if the source could not be initialized.
return create_task(m_mediaCapture->InitializeAsync(settings))
.then([this](task<void> initializeMediaCaptureTask)
{
try
{
// Get the result of the initialization. This call will throw if initialization failed
// This pattern is docuemnted at https://msdn.microsoft.com/en-us/library/dd997692.aspx
initializeMediaCaptureTask.get();
m_logger->Log("MediaCapture is successfully initialized in shared mode.");
return true;
}
catch (Exception^ exception)
{
m_logger->Log("Failed to initialize media capture: " + exception->Message);
return false;
}
});
When I start others project like 'ComputeOnDevice', I can see an alert message window asking me allow to access camera. However, when I start 'SensorStreamViewer', I didn't see any alert message asking about camera access.
I started debugging, and confronted this error message.
Exception thrown at 0x772C3332 in SensorStreamViewer.exe: Microsoft C++ exception: Platform::AccessDeniedException ^ at memory location 0x0180E680. HRESULT:0x80070005 Access is denied.
WinRT information: The required device capability has not been declared in the manifest.
How can I solve this problem?
In your Package.appxmanifest file, you need to add the following capability.
<rescap:Capability Name="perceptionSensorsExperimental" />

Is there a way for a RACSignal to keep receiving `next`s after an error?

I'm trying to listen for both location updates and errors (through CLLocationManagerDelegate), and support the ability to track errors but filter them out of the final signal and keep it alive.
When I subscribe to the location signal (via ReactiveCocoaPlayground's -[LocationManager currentLocationSignal]), any errors received will end the signal.
I've tried -catch: and -catchTo: but those just catch one error and then end the signal.
I've tried returning a brand new instance of that signal inside -catch:, but then the error on THAT signal is uncaught (which causes a crash in a RAC() binding later on).
I've tried a recursive approach to that catch as well, which caused a stack overflow (maybe I just made a mistake though).
Is there a way to receive nexts after errors occur?
I believe you're looking for -[RACSignal retry]:
/// Resubscribes to the receiving signal if an error occurs.
- (RACSignal *)retry;

Simperium Received an Invalid Change

I am developing integration with Simperium, the integration is complete and has been running on test machines for sometime, I am starting to get this error on one of the devices and it keeps repeating constantly any ideas?
MeetingPad[891:1103] Simperium error (ActionLinks82), received an invalid change for (a18852011efe4964a6fdeb1853c790f3)
2013-02-07 10:07:05:277 MeetingPad[891:1103] Simperium client ios-7f43b434754d882923e966df5d885755 received change (ActionLinks82) ios-4176925448fa8ae0a2f1d0937627aa6b: {
ccids = (
3f3b4550b23147d49e194038feea09a6
);
clientid = "ios-4176925448fa8ae0a2f1d0937627aa6b";
cv = 5112df4b37a401031dcc5be1;
ev = 2;
id = 9ca0b7ad04314ab9888d75691be784b5;
o = "-";
}
If this occured on a user account what would be the guidance?
One thing to check is that you're using the latest version of the code. The repository was recently open sourced on GitHub. There used to be a bug related to nil values that could cause an invalid diff to appear in your change stream, but it should be fixed now.
Assuming you're using the latest code though, does the error repeat continuously for the same "id" value, or are there different values?
Looking at the Simperium code where this error occurs, it's possible it could be displayed if you've deleted an object locally and remotely at around the same time. In your app, might ActionLinks fit that pattern, i.e. are you creating and deleting a lot of them across multiple clients?
If that is indeed the cause, then the error is innocuous and we should patch the code. Let me know what you discover.

Resources