0

Some simple things sometimes just don't work ;) like this one! Am trying to integrate Google+ SDK into an iPhone App by following the instructions given here:

https://developers.google.com/+/mobile/ios/#initialize_the_google_client

I did every single step. But when I build the App, it complains of the following errors:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_GTMOAuth2Keychain", referenced from:
      objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
  "_OBJC_CLASS_$_GTMOAuth2SignIn", referenced from:
      objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
  "_OBJC_CLASS_$_GTMOAuth2ViewControllerTouch", referenced from:
      objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The classes it's reporting of, are part of the Open Source Google Toolbox project (which is also present in the downloaded SDK, but the instructions ask the user to include only GooglePlusShare.h and libGooglePlusUniversal.a in the project in XCode). I tried including the header files from the directory 'google-plus-ios-sdk-1.0.0\OpenSource', but that's of no use. I tried including the entire (not just .h files) from the directory 'google-plus-ios-sdk-1.0.0\OpenSource' & it leads to lot of ARC related errors (more than 500 of them!); so I quit this option.

Any help on how to resolve these linker errors please?

My environment: XCode 4.3.3, iOS 5.0, Mac OS X Lion 10.7.4, testing with iPhone 4

Jean
  • 2,611
  • 8
  • 35
  • 60

2 Answers2

1
 Just select GData.xcodeproj .
 select GDataTouchStaticLib from target .
 search "othet c flag"
 remove "-DGTM_INCLUDE_OAUTH2=1" if exist

 add "-DGDATA_INCLUDE_OAUTH2=1"
 click on done. clean project and then build.
iKushal
  • 2,689
  • 24
  • 20
0

Missing keychain and auth-stuff usually means you never imported the Security.framework in your project.

Check another time if you really did include the libraries

  • Security.framework
  • SystemConfiguration.framework

in your Xcode project as described in step 1 of the instructions you referred to.

To verify this:

  • Click on your project name in xcode and select your target.
  • Under the tab "Build Phases" these two frameworks should be listed under the secition called "Link Binary With Libraries".
  • If not listed, press the + button to add them.
jake_hetfield
  • 3,388
  • 1
  • 23
  • 30
  • Thanks for your response, Jake. But I checked again; I do have both of those libraries included in the target. – Jean Aug 15 '12 at 13:37
  • 1
    Odd, as a last check to make sure it builds with the latest settings you could try to clean the project derived data files completely by going to organizer -> Projects -> Your project -> Delete (Derived data) – jake_hetfield Aug 15 '12 at 14:08
  • Hi Jake, The G+ website tutorial on the integration into iOS App now (I don't remember seeing it earlier when I tried the integration) says: "Include all files from the OpenSource directory in your Xcode project." But then, this produces innumerable errors as my project is in ARC, whereas the included 'Open Source' directory code is not. Is there an ARC-compliant version of the G+ library (or the Open Source Google Toolkit for Mac)? – Jean Aug 24 '12 at 14:35
  • Hi Jean. All you need to do is to disable ARC for the files that do not support it. It is fully supported to have both ARC and non-ARC code in your project. See this question: http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project – jake_hetfield Aug 24 '12 at 15:07