Xcode 7上的Gmail API快速入门说明无法使用 [英] Quick start instructions for Gmail API on Xcode 7 do not work

查看:112
本文介绍了Xcode 7上的Gmail API快速入门说明无法使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继续阅读



然后你就会发现我在上面,连接器出现问题。在摸索网络并查看缺少的内容后,问题在于构建需要多个附加文件: stack.imgur.com/FA9EY.pngrel =nofollow noreferrer>



除了快速入门指示的红色短划线之外,我还标记了必须添加的项目。另请注意,其中一些必须在没有ARC的情况下进行编译,这在红色圆圈中显示。

接下来,在我的项目中包括此项。

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!

解决方案

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):

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:

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.

这篇关于Xcode 7上的Gmail API快速入门说明无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆