gpt4 book ai didi

ios - GoogleCloudMessaging 链接错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:11:41 25 4
gpt4 key购买 nike

我需要在我的应用中使用 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];

我有这些错误:

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GGLInstanceID", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_GGLInstanceIDConfig", referenced from: objc-class-ref in AppDelegate.o "_kGGLInstanceIDAPNSServerTypeSandboxOption", referenced from: -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o "_kGGLInstanceIDRegisterAPNSOption", referenced from: -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o "_kGGLInstanceIDScopeGCM", referenced from: -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

项目设置:

-> 仅构建事件架构 - 是

-> Other Linked Flags 包含 $(inherited)

-> 部署目标 - 8.0

请帮帮我!提前致谢!

最佳答案

检查 4 件事:

  1. 您尚未在您的项目中手动上传 GoogleCloudMessaging。如果有,删除它们并重新安装 pod。

  2. 检查您的build设置中的链接器路径设置。在安装 pod 之前使用“$inherited”。

  3. 重新安装 pod 后,使用 cmd + shift + k 清理您的项目,然后运行您的项目。

  4. 仅构建事件架构 - 否,对于目标 - 是

关于ios - GoogleCloudMessaging 链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33430435/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com