简体   繁体   中英

Google Cloud Messaging Bridging Header import fails

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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