ios – 配置Google服务时出错:Error Domain = com.google.greenhouse Code = -106缺少预期的子规格

ios – 配置Google服务时出错:Error Domain = com.google.greenhouse Code = -106缺少预期的子规格,第1张

概述我正在整合 Google cloud messaging. 我通过cocoapods安装谷歌云消息. pod 'Google/CloudMessaging' 我的GoogleService-Info.plist: – 运行工作区时出错: – Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, r 我正在整合 Google cloud messaging.

我通过cocoapods安装谷歌云消息.

pod 'Google/CloudMessaging'

我的GoogleService-Info.pList: –

运行工作区时出错: –

Terminating app due to uncaught exception
‘NSInternalinconsistencyException’,reason: ‘Error configuring Google
services: Error Domain=com.Google.greenhouse Code=-106 “Missing
expected subspecs.” UserInfo={NSLocalizedDescription=Missing expected
subspecs.

我错过了任何其他依赖的cocoapod或项目设置吗?

解决方法 这是因为您使用GGLContext类来设置谷歌服务.在GoogleServices-Info.pList中,提供了未包含库的已启用服务.我的情况是IS_SIGNIN_ENABLED = YES和IS_ADS_ENABLED = YES.

NSError* configureError;                                                     [[GGLContext sharedInstance] configureWithError:&configureError];            if (configureError) {                                                            RLog(@"Error configuring Google services: %@",configureError);              return;                                                                  }                                                                            _gCMSenderID = [[[GGLContext sharedInstance] configuration] gCMSenderID];

我还遇到了这个问题,然后从Firebase Console下载了GoogleServices-Info.pList.为了解决这个问题,我删除了GGLContext类,并使用从原始文件中的GCM_SENDER_ID键获取的值来硬编码_gCMSenderID.

_gCMSenderID = @"778899223344";

但您可以通过在GoogleServices-Info.pList文件中设置为NO来禁用这些服务

总结

以上是内存溢出为你收集整理的ios – 配置Google服务时出错:Error Domain = com.google.greenhouse Code = -106缺少预期的子规格全部内容,希望文章能够帮你解决ios – 配置Google服务时出错:Error Domain = com.google.greenhouse Code = -106缺少预期的子规格所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1002281.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存