Quick start instructions for Gmail API on Xcode 7 do not work(Xcode 7 上 Gmail API 的快速启动说明不起作用)
问题描述
跟进
然后,您将遇到我上面提到的链接器问题.在网上摸索并查看丢失的内容后,问题是构建需要几个额外的文件:
除了快速入门中指示的内容外,我还用红色破折号标记了必须添加的内容.另请注意,其中一些必须在没有 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 的快速启动说明不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Xcode 7 上 Gmail API 的快速启动说明不起作用
基础教程推荐
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01