AWS iOS Cognito Sync Error - Unrecognized Selector Sent To Class - ios

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?

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.

Related

I got Crash when integrating Applovin Max Ad iOS

I am trying to integrate Applovin Ad into my project. But I get a crash when trying to integrate
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM al_isValidString]: unrecognized selector sent to instance 0x28116aa30'
Below is my code:
ALSdk.shared()!.mediationProvider = ALMediationProviderMAX ALSdk.shared()!.initializeSdk(completionHandler: { _ in })
I tried creating new project and it works. But on my project still Crash. My project integrates admob, iron ads and applovin
I found the error at this line
ALSdk.shared()!.mediationProvider = ALMediationProviderMAX
I use Cocoapods to install
pod 'AppLovinSDK'
It creates 2 paths to that file. But when I click on it, it still only points to 1 file
See this photo to know more
That makes xcode not know which file's func to use. And generate the above error. Hope this helps everyone

How to fix [AWSTask exception] crash in AWSCore (AWS-sdk-ios)

I use AWS-SDK for iOS 2.6.14 (latest through Cocoapods) and have faced next issue:
I got a message in Xcode console:
-[AWSTask exception]: unrecognized selector sent to instance 0x17587ac00
And then application is crashed.
I've tried to prevent it by creating custom extension:
extension AWSTask {
public func exception() {
print("AWSTask exception method called")
}
}
I know that it's awful solution but I have no idea how to fix the issue which source is in 3rd-party component.
Then I've got next message and app crash:
*** Terminating app due to uncaught exception of class 'AWSTask'
Exception breakpoint stops in AWSTask method - (AWSTask *)continueWithExecutor:(AWSExecutor *)executor block:(AWSContinuationBlock)block cancellationToken:(nullable AWSCancellationToken *)cancellationToken
On line id result = block(self);
(It's in source code of AWSCore framework).
I have searched for similar issues on AWS-sdk-ios GitHub and found some but it contain no answer.
I also created new issue myself.
How can I fix it on my side?
As it turns out I have AWSMobileHubHelper.framework integrated as static library. It seems it is the source of the crash.
I found AWSMobilehubHelper's source at this repo.
But unfortunately can't manage to build a static library (because of building script issue).
Eventually, I've added the source to project with the bridging header.
And it seems to work now.

Firebase app invite crashing on swift ios

I've added firebase app invites in my swift based iOS application. I have followed this complete instructions however, it has been crashing on invite.open() line while showing invite dialog.
The error is:
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** setObjectForKey: object cannot be nil (key: GINInviteResources.bundle)'.
Did anyone managed to make it work?
After digging for 2 days what I found was FirebaseInvites.framework seems to have resource dependancies for GINInviteResources.bundle and GPPACLPickerResources.bundle.
Somehow, pod was not including it in to my project.(Still could not find why) but adding this two dependencies manually in to my target worked like a charm.
PS: Adding this answer to save someone's effort.
Right, I too faced this.
Download framework SDK zip from https://firebase.google.com/docs/ios/setup and get those bundles from \Invites\Resources\..

Irritating and confusing hosted applinks issue on iOS

All my hosted facebook applinks used to parse in my app using the bolts framework fine. I go to sleep, wake up and now none of my hosted applinks parse and my app crashes when trying to parse them using the bolts framework.
I have even tested a legacy build of my app on an older device which is archived and has previously passed my test spec's and even that now crashes? Is anyone else experiencing issues parsing hosted facebook applinks on iOS via the bolts framework?
Error message:
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized
selector sent to instance 0x37419830'
We had that same issue yesterday, but it disappeared by itself. Seems like Facebook might have pushed a fix already.
All the new links are working fine, and the ones that were broken are working after a reinstallation of the Facebook App (might have been cached by the app).

pushwoosh error unrecognized selector sent to instance Cordova 1.7.0

I am trying out pushwoosh and tried unregistering an iOS device on the remote api and this error came up:
-[__NSDictionaryI cdvjk_JSONString]: unrecognized selector sent to instance
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [__NSDictionaryI cdvjk_JSONString]: unrecognized selector sent to instance
*** First throw call stack:
libc++abi.dylib: terminate called throwing an exception
Sending request: {"request":{"hwid":"my_hwid", "application":"my_app_id"}}
To urL https://cp.pushwoosh.com/json/1.3/pushStat
(lldb)
I then realized that the unregister method is implemented only for androids and not iOS devices so that request was not being used by the pushwoosh plugins in the plugins folder.
I removed the code from my index.js and pushnotifications.js files but still the error came up every time I tried to launch the app after accepting a push notification.
I then removed this code from the remote api:
new JObject(
new JProperty("custom", "json data"))),
new JProperty("link", "http://pushwoosh.com/")
with the hope that the seemingly custom data wil not be sent to pushwoosh.
Still the error appears. I know that the problem is that an unhanded request is being made every time but the problem is that the code does not exist.
Could I have possibly edited some method signatures and these signatures are being used each and every time I try to accept a push notification?
Or is it that Xcode performs auto-complete?
I would need someone who is familiar with pushwoosh (and Xcode) to help me out here. What would be the workaround without having to upgrade to Cordova 2.1.0 or later since (This error comes from the plugin itself, Phonegap guys have changed the way "JSONString" objective-c function gets called by adding prefix "cdvjk_" breaking the compatibility of the plugins with any < 2.1 Phonegap versions.)?
Please read this thread. Unfortunately, this is kinda fault of PhoneGap guys, who made it impossible to support both Cordova 2.1 and earlier versions:
https://github.com/shaders/phonegap-cordova-push-notifications/issues/12
You can contact Pushwoosh team asking if they still can help you with the older versions.

Resources