ios - GoogleCloudMessaging 链接错误
<p><p>我需要在我的应用中使用 <strong>GoogleCloudMessaging</strong>。我通过 <strong>Cocoapods</strong> 安装了它。
当我添加这部分代码时:</p>
<pre><code>GLInstanceIDConfig *instanceIDConfig = ;
instanceIDConfig.delegate = self;
// Start the GGLInstanceID shared instance with the that config and request a registration
// token to enable reception of notifications
[ startWithConfig:instanceIDConfig];
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@YES};
[ tokenWithAuthorizedEntity:GCMSSenderID
scope:kGGLInstanceIDScopeGCM
options:_registrationOptions
handler:_registrationHandler];
</code></pre>
<p>我有这些错误:</p>
<blockquote>
<p>Undefined symbols for architecture x86_64:<br/>
"_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:
- in
AppDelegate.o "_kGGLInstanceIDRegisterAPNSOption", referenced from:
- in
AppDelegate.o "_kGGLInstanceIDScopeGCM", referenced from:
- 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)</p>
</blockquote>
<p>项目设置:</p>
<p>-> 仅构建事件架构 - 是</p>
<p>-> 其他链接标志包含 $(inherited)</p>
<p>-> 部署目标 - 8.0</p>
<p>请帮帮我!
提前致谢!</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>检查 4 件事:</p>
<ol>
<li><p>您尚未在项目中手动上传 <strong>GoogleCloudMessaging</strong>。如果有,请删除它们并重新安装 pod。</p></li>
<li><p>检查您的<strong>build设置中的链接器路径设置</strong>。在安装 pod 之前使用 '<strong>$inherited</strong>'。</p></li>
<li><p>重新安装 pod 后,使用 <kbd>cmd</kbd> + <kbd>shift</kbd> + <kbd>k</kbd> 清理您的项目,然后运行您的项目。</p> </li>
<li><p>仅构建事件架构 - 否,针对目标 - 是</p></li>
</ol></p>
<p style="font-size: 20px;">关于ios - GoogleCloudMessaging 链接错误,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/33430435/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/33430435/
</a>
</p>
页:
[1]