简体   繁体   English

Google Cloud Messaging桥接标题导入失败

[英]Google Cloud Messaging Bridging Header import fails

I'm implementing Google Cloud Messaging in my Swift iOS app. 我正在我的Swift iOS应用中实现Google Cloud Messaging。 I was following this guide: https://developers.google.com/cloud-messaging/ios/client?ver=swift 我正在遵循此指南: https : //developers.google.com/cloud-messaging/ios/client?ver=swift

First I changed the pods file, then I ran pod install. 首先,我更改了pods文件,然后运行了pod安装。 This worked fine. 这很好。 Since Swift needs a bridging header to include the ObjC Library I extended my header like suggested in the guide to 由于Swift需要桥接头文件来包含ObjC库,因此我按照指南中的建议扩展了头文件

#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. 我注意到以下事实:CloudMessaging.h不在Google文件夹中,而是在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. 项目构建良好,但未找到GCM类,因为未找到标头。

Digging deeper: 深层发掘:

I tried to add CloudMessaging from scratch: I ran pod init and changed the podfile to 我尝试从头开始添加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

then it works 然后它起作用

If I use my podfile 如果我使用我的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 错误仍然存​​在

更新可可豆荚可解决此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM