Google云消息传递桥接头导入失败
我正在Swift iOS应用程序中实施Google Cloud Messaging。 我是按照这个指南: https : //developers.google.com/cloud-messaging/ios/client ?ver = swift
首先我更改了pod文件,然后运行了pod安装。 这工作得很好。 由于Swift需要一个桥接头来包含ObjC库,所以我把头部扩展到了指南中的build议
#import <Google/CloudMessaging.h>
但导入失败 – 找不到文件。
我注意到CloudMessaging.h不在Google文件夹中,而是在Google / CloudMessaging中。 不幸的是import
#import <Google/CloudMessaging/CloudMessaging.h>
既不起作用。
这里是我的豆荚看起来像一个截图
有没有人注意到同样的问题? 任何想法来解决它? 项目生成良好,除非由于没有find标题而找不到GCM类。
深层发掘:
我尝试从头开始添加CloudMessaging:我运行了pod init并将podfile更改为
# 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
那么它的工作
如果我使用我的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'
错误依然存在
更新cocoa豆荚解决了这个问题