1

Following up on Gmail API iOS in Xcode 7, Swift 2, I followed the directions, but then ran into the problems listed here: https://groups.google.com/forum/#!topic/google-api-objectivec-client/Eq2yW8KdjRU. They point out a few things that are wrong with the Quickstart instuctions and I (as they did) worked thru them as best we could. In the end, the remaining problem is linking, which looks like:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GTLObject", referenced from:
  _OBJC_CLASS_$_GTLGmailDraft in GTLGmail_Sources.o
  _OBJC_CLASS_$_GTLGmailHistoryLabelAdded in GTLGmail_Sources.o
  _OBJC_CLASS_$_GTLGmailHistoryLabelRemoved in GTLGmail_Sources.o
  _OBJC_CLASS_$_GTLGmailMessage in GTLGmail_Sources.o
  _OBJC_CLASS_$_GTLGmailHistoryMessageAdded in GTLGmail_Sources.o
  _OBJC_CLASS_$_GTLGmailHistoryMessageDeleted in GTLGmail_Sources.o
  _OBJC_CLASS_$_GTLGmailHistory in GTLGmail_Sources.o
  ...
"_OBJC_CLASS_$_GTLQuery", referenced from:
  _OBJC_CLASS_$_GTLQueryGmail in GTLGmail_Sources.o
 (maybe you meant: _OBJC_CLASS_$_GTLQueryGmail)
"_OBJC_CLASS_$_GTLService", referenced from:
  _OBJC_CLASS_$_GTLServiceGmail in GTLGmail_Sources.o
 (maybe you meant: _OBJC_CLASS_$_GTLServiceGmail)
"_OBJC_CLASS_$_GTMOAuth2ViewControllerTouch", referenced from:
  type metadata accessor for __ObjC.GTMOAuth2ViewControllerTouch in ViewController.o
"_OBJC_METACLASS_$_GTLObject", referenced from:
  _OBJC_METACLASS_$_GTLGmailDraft in GTLGmail_Sources.o
  _OBJC_METACLASS_$_GTLGmailHistory in GTLGmail_Sources.o
  _OBJC_METACLASS_$_GTLGmailHistoryLabelAdded in GTLGmail_Sources.o
  _OBJC_METACLASS_$_GTLGmailHistoryLabelRemoved in GTLGmail_Sources.o
  _OBJC_METACLASS_$_GTLGmailHistoryMessageAdded in GTLGmail_Sources.o
  _OBJC_METACLASS_$_GTLGmailHistoryMessageDeleted in GTLGmail_Sources.o
  _OBJC_METACLASS_$_GTLGmailLabel in GTLGmail_Sources.o
  ...

In the SO thread above I first referenced, it is suggested that a new Gmail SDK corrects these problem. I re-pulled everything two days ago but still have the linking errors.

So I am not sure how to install the new version of the SDK as mentioned ... can someone point me as to which SDK I am updating and how to do it? Thanks!

Community
  • 1
  • 1
user1857742
  • 151
  • 2
  • 10
  • From http://stackoverflow.com/questions/28033635/why-does-the-ios-simulator-require-i386-and-x86-64-symbols-even-though-im-on-an - I see that the i386 build is just for the simulator. Maybe it will work on a real phone if I adjust build targets, I need to test that. – user1857742 Jan 18 '16 at 15:09

1 Answers1

1

OK I figured it out. First you need to overcome the 'glitches' as described https://groups.google.com/forum/#!topic/google-api-objectivec-client/Eq2yW8KdjRU . This includes noting that the projects now have the word 'Core' added to them, fixing the swift file for 2.0 operation, ignoring Steps 3e and f. Also, make sure that each project has iOS selected as architecture. As I thought the i386 build is for the simulator, to explicitly show why that is getting build you can see this here (iOS is implying both iphoneos and iphonesimulator even though i386 does not show in the Valid Architectures list):

enter image description here

You will then be at the spot that I was above, with linker problems. After fumbling around the net and seeing what was missing, the problem is that several additional files are required for the build:

enter image description here

I marked the ones that must be added in addition to the ones indicated in the quickstart with red dashes. Also note that some of these must be compiled without ARC, this is shown in the red circle.

Next, including this in my project.

user1857742
  • 151
  • 2
  • 10