-1

Edit: This is not a duplicate of any other question on SO - which I already researched. I understand what an "unrecognized selector sent to class" error message means and how to troubleshoot them. This error is unique to Amazon Web Services SDK for iOS and its frameworks, nothing that I wrote or could troubleshoot as suggested by @Hot Licks.

I have been working on this issue for some time. In the process of debugging and authentication starting to work, Cognito Sync began to fail.

My code:

AWSCognito *syncClient = [AWSCognito defaultCognito];

fails with the error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[AWSEndpoint endpointWithRegion:service:]: unrecognized selector sent to class

The headers used:

#import <AWSiOSSDKv2/AWSCore.h>
#import <AWSCognitoSync/Cognito.h>

I am using SDK 2.0.17.

This code worked while users were unauthenticated. Once authentication started working, I get this error. I also upgraded from SDK 2.0.8 to 2.0.17 during the authentication debug process. Any ideas out there?

Community
  • 1
  • 1
Spidey
  • 696
  • 8
  • 11
  • possible duplicate of [How can I debug 'unrecognized selector sent to instance' error](http://stackoverflow.com/questions/25853947/how-can-i-debug-unrecognized-selector-sent-to-instance-error) – Hot Licks Apr 03 '15 at 00:57

1 Answers1

1

It seems like you have upgraded AWSiOSSDKv2.framework to 2.0.17, but AWSCognitoSync.framework is still 2.0.8. Please make sure to use the same version for both frameworks.

Yosuke
  • 3,759
  • 1
  • 11
  • 21
  • I deleted the AWSCognitoSync.framework and re-copied from the extracted 2.0.17 zip file to the project. Re-running the code throws the same error. – Spidey Apr 03 '15 at 20:14
  • Instead of using the frameworks installation method I changed over to the cocoapods installation method: http://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup.html and the code now executes the Cognito Sync properly. There must have been another dependency on SDK 2.0.8 or the framework was not completely removed from the project when I moved AWSCognitoSync.framework to the trash. Here is what I did: 1) Installed updates using cocoapods as shown in link above 2) Opened my project's .xcworkspace 3) Opened Simulator and "Reset Contents and Settings..." 4) Ran application successfully – Spidey Apr 04 '15 at 13:06