我正在整合Google cloud messaging。
我通过cocoapods安装谷歌云消息。
pod 'Google/CloudMessaging'
我的GoogleService-Info.plist: -
运行工作区时遇到错误: -
由于未捕获的异常而终止应用 ' NSInternalInconsistencyException',原因:'配置Google时出错 services:Error Domain = com.google.greenhouse Code = -106" Missing 预期的亚种。" UserInfo = {NSLocalizedDescription =缺少预期 subspecs。
我错过了任何其他依赖的cocoapod或项目设置吗?
答案 0 :(得分:0)
这是因为您使用GGLContext
类来设置Google服务。在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控制台下载了GoogleServices-Info.plist
。为解决此问题,我将GGLContext
类和硬编码_gcmSenderID
删除了从原始文件中的GCM_SENDER_ID
键获取的值。
_gcmSenderID = @"778899223344";
但您可以通过在NO
文件
GoogleServices-Info.plist
来停用这些服务