Google Drive SDK和iOS 5.1

SDK是否与iOS 5兼容或只与iOS 6兼容?

一切都很好,谷歌exemple和iOS 6(模拟器和设备),但Xcode返回运行时错误与iOS 5.1(模拟器和设备)。

我正在使用Xcode 4.5.2。

我已经检查了iOS部署目标。 它设置在5.1。

Google示例: https : //developers.google.com/drive/quickstart-ios

运行时错误返回:

dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty_nonatomic_copy Referenced from: /Users/Borongaj/Library/Application Support/iPhone Simulator/5.1/Applications/FC5B32F0-C5E6-4054-BE81-4F52054AC911/Tests Google Drive.app/Tests Google Drive Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation dyld: Symbol not found: _objc_setProperty_nonatomic_copy Referenced from: /Users/Borongaj/Library/Application Support/iPhone Simulator/5.1/Applications/FC5B32F0-C5E6-4054-BE81-4F52054AC911/Tests Google Drive.app/Tests Google Drive Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation 

我find了解决scheme。

Google文档忽略了一些重要的事情:

  1. 观看Googlevideo而不是阅读Google教程(文本),因为某些拖放操作可能会破坏Xcode大楼的偏好设置

  2. 在Project> Build Phases> Compile Sources中添加GTLDrive_Sources.m

  3. GTL项目的iOS部署目标选项切换到5.1(或其他)。

有了这三个步骤,你可以避免一些无聊的错误信息。

即使Google工程师在video中也会遇到同样的错误! 🙂

我在Xcode 6.1.1上将iOS开发目标设置为5.1.1来解决这个问题。