7

I am facing problem while integrating the google plus log i got the following error:

2015-02-17 20:03:39.377 SIR[288:14344] -[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x14d57a20
2015-02-17 20:03:39.383 SIR[288:14344] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x14d57a20'

The code i used to google login is below:

 -(void) setGooglePlusButtons {
UIButton *googlePlusSignInButton = [UIButton buttonWithType:UIButtonTypeCustom] ;


UIImage *backgroundButtonImage = [UIImage imageNamed:@"google.png"];

googlePlusSignInButton.frame = CGRectMake(0.0f,
                                           400,
                                           150,
                                           50);

googlePlusSignInButton.titleLabel.textColor = [UIColor whiteColor];
googlePlusSignInButton.titleLabel.font = [UIFont boldSystemFontOfSize:11.0f];
googlePlusSignInButton.titleLabel.numberOfLines = 2;

googlePlusSignInButton.titleLabel.shadowColor = [UIColor darkGrayColor];
googlePlusSignInButton.titleLabel.shadowOffset = CGSizeMake(0.0f,
                                                             -1.0f);

[googlePlusSignInButton setTitle:NSLocalizedString(@"", @"")
                         forState:UIControlStateNormal];

[googlePlusSignInButton setBackgroundImage:backgroundButtonImage
                                   forState:UIControlStateNormal];
[self.view addSubview:googlePlusSignInButton];

[googlePlusSignInButton addTarget:self action:@selector(signInGoogle) forControlEvents:UIControlEventTouchUpInside];}

- (void)signInGoogle {
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.delegate = self;
signIn.shouldFetchGoogleUserEmail = YES;
signIn.clientID = KclientId;
signIn.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin,nil];
signIn.actions = [NSArray arrayWithObjects:@"http://schemas.google.com/ListenActivity",nil];
[[GPPSignIn sharedInstance] authenticate];}


- (void)signOut {
[[GPPSignIn sharedInstance] signOut];}

and in app delegate

    - (BOOL)application: (UIApplication *)application openURL: (NSURL *)url sourceApplication: (NSString *)sourceApplication annotation: (id)annotation {

return [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation];}

and i declared at the top kclientId

static NSString * const KclientId=@"xxxxxxxxxxxxxxx.apps.googleusercontent.com";

i have tried it on my end but i am not able to found the issue that where i am going wrong.

PAn Kaj Khatri
  • 539
  • 1
  • 6
  • 22
  • 2
    possible duplicate of [Image Sharing Using Google Plus in ios](http://stackoverflow.com/questions/17857588/image-sharing-using-google-plus-in-ios) – Larme Feb 17 '15 at 14:52
  • @Larme i am getting this error while i am authenticate the GPPSignIn – PAn Kaj Khatri Feb 17 '15 at 16:04
  • for those guys who didn't find any solution after looking at below answers; please make sure you have added every necessary framework in project with target membership checked. – Vikram Sinha Jul 24 '18 at 10:45

4 Answers4

20

I faced the same issue with Swift,I think you must enable some flags on the build setting and enable some library.

  1. Go to Build settings / Linking / Other Linker Flags and add the "-ObjC" without the quotes. This assume you are using some "header file" to map Google framework and for Swift approach.

  2. Go to Build Phases >Link Binary with Librairies > + > Add other, the go to de /usr/lib directory and select "libz.dylib"

  3. Compile

Zerausolrac
  • 321
  • 2
  • 3
1

The NSDictionary extension, that defines gtm_httpArgumentsString is located in GoogleToolboxForMac framework. Make sure you link to that framework.

Vladimir Grigorov
  • 10,903
  • 8
  • 60
  • 70
0

I forgot to add Google Utilities framework which was left.It worked for me!

mohsin
  • 530
  • 5
  • 24
0

if you don't want to add -ObjC flag, then you need to force load the framework it will work.

Add like this in your other linker flags -force_load "path of your framework"

Let me know if you face any issue.

Amit Thakur
  • 1,081
  • 12
  • 14