I have an iOS Swift project using the AWSMobileClient SDK (v2.9.9) installed with Cocoapods.
There is one problematic method that is used quite frequently in the app:
AWSMobileClient.sharedInstance().getAWSCredentials { (credentials, error) in ... }
and there is a specific fatal error that occurs:
Obtaining an identity id in another thread failed or didn't complete within 5 seconds.
On some devices, it works fine 90% of the time and only usually occurs after a sequence of steps - e.g. sign in, log out, sign in again (the method is called after sign in).
However, recently on a new device that I've been testing on it has appeared every single time.
There was another Stack question here that suggested that another AWS SDK operation may be running in parallel when getAWSCredentials
is called - but after reviewing my code I'm fairly sure this isn't the case.
I've also tried running this method on the failing device to see if it would give any clues:
AWSMobileClient.sharedInstance().getIdentityId().continueWith { task -> Any? in ... }
and returns with this error:
Fetching identity id on another thread failed. Please retry by calling
getIdentityId()
method.
I've spent hours looking through my own code and the stack traces that led to the error and am at a dead end with thoughts on how to solve or even debug this further.
Hopefully someone will be able to suggest something to help me - thanks! :)