【发布时间】:2016-01-30 13:13:46
【问题描述】:
我需要在我的应用中使用 GoogleCloudMessaging。我通过 Cocoapods 安装了它。 当我添加这部分代码时:
GLInstanceIDConfig *instanceIDConfig = [GGLInstanceIDConfig defaultConfig];
instanceIDConfig.delegate = self;
// Start the GGLInstanceID shared instance with the that config and request a registration
// token to enable reception of notifications
[[GGLInstanceID sharedInstance] startWithConfig:instanceIDConfig];
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@YES};
[[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:GCMSSenderID
scope:kGGLInstanceIDScopeGCM
options:_registrationOptions
handler:_registrationHandler];
我有这些错误:
架构 x86_64 的未定义符号:
“_OBJC_CLASS_$_GGLInstanceID”,引用自: AppDelegate.o "_OBJC_CLASS_$_GGLInstanceIDConfig" 中的 objc-class-ref,引用自: AppDelegate.o "_kGGLInstanceIDAPNSServerTypeSandboxOption" 中的 objc-class-ref,引用自: -[AppDelegate 应用程序:didRegisterForRemoteNotificationsWithDeviceToken:] 在 AppDelegate.o“_kGGLInstanceIDRegisterAPNSOption”,引用自: -[AppDelegate 应用程序:didRegisterForRemoteNotificationsWithDeviceToken:] 在 AppDelegate.o "_kGGLInstanceIDScopeGCM",引用自: -[AppDelegate 应用程序:didRegisterForRemoteNotificationsWithDeviceToken:] 在 AppDelegate.o ld:未找到架构 x86_64 的符号 错误:链接器命令失败,退出代码为 1(使用 -v 查看 调用)
项目设置:
-> 仅构建活动架构 - 是
-> 其他链接标志包含 $(inherited)
-> 部署目标 - 8.0
请帮帮我! 提前致谢!
【问题讨论】:
-
确保您正在构建工作区,而不是项目,因为 CocoaPods 是工作区中的另一个独立项目
标签: ios objective-c google-cloud-messaging