Google云消息传递桥接头导入失败 [英] Google Cloud Messaging Bridging Header import fails

查看:78
本文介绍了Google云消息传递桥接头导入失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Swift iOS应用中实施Google Cloud Messaging。
我遵循本指南:



任何人都注意到同样的问题任何想法来解决它?
项目构建正常,但由于没有找到标题而未找到GCM类。



深入挖掘:

我尝试从头开始添加CloudMessaging:
我运行了pod init并将podfile更改为

  #取消注释此行为您的项目定义全球平台
#platform:ios,'6.0'

target'Google Cloud Push iOS'做
pod'Google / CloudMessaging'
end

target'Google Cloud Push iOSTests'do

end

然后它可以工作



如果我使用我的podfile

  source'https://github.com/CocoaPods/Specs.git'
#platform:ios,'8.0'
use_frameworks!

pod'Alamofire','〜> 1.3'
pod'ObjectMapper','〜> 0.14'
pod'AlamofireObjectMapper','〜> 0.7'
pod'HanekeSwift'
pod'Google / CloudMessaging'

错误仍然存​​在

解决方案

更新可可豆荚修复此问题

I'm implementing Google Cloud Messaging in my Swift iOS app. I was following this guide: https://developers.google.com/cloud-messaging/ios/client?ver=swift

First I changed the pods file, then I ran pod install. This worked fine. Since Swift needs a bridging header to include the ObjC Library I extended my header like suggested in the guide to

#import <Google/CloudMessaging.h>

But the import fails - file not found.

I noticed the fact that CloudMessaging.h is not in the Google folder directly but in Google/CloudMessaging. Unfortunately the import of

#import <Google/CloudMessaging/CloudMessaging.h>

works neither.

Here is a screenshot of what my pods look like

Did anyone notice the same problem? Any Ideas to fix it? Project builds fine except that the GCM classes are not found since the header is not found.

Digging deeper:

I tried to add CloudMessaging from scratch: I ran pod init and changed the podfile to

# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'

target 'Google Cloud Push iOS' do
pod 'Google/CloudMessaging'
end

target 'Google Cloud Push iOSTests' do

end

then it works

If I use my podfile

source 'https://github.com/CocoaPods/Specs.git'
#platform :ios, '8.0'
use_frameworks!

pod 'Alamofire', '~> 1.3'
pod 'ObjectMapper', '~> 0.14'
pod 'AlamofireObjectMapper', '~> 0.7'
pod 'HanekeSwift'
pod 'Google/CloudMessaging'

the error remains

解决方案

updating cocoa pods fixes this issue

这篇关于Google云消息传递桥接头导入失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆