[英]Google Cloud Messaging Bridging Header import fails
我正在我的Swift iOS應用中實現Google Cloud Messaging。 我正在遵循此指南: https : //developers.google.com/cloud-messaging/ios/client?ver=swift
首先,我更改了pods文件,然后運行了pod安裝。 這很好。 由於Swift需要橋接頭文件來包含ObjC庫,因此我按照指南中的建議擴展了頭文件
#import <Google/CloudMessaging.h>
但是導入失敗-找不到文件。
我注意到以下事實:CloudMessaging.h不在Google文件夾中,而是在Google / CloudMessaging中。 不幸的是進口
#import <Google/CloudMessaging/CloudMessaging.h>
都不起作用。
這是我的吊艙外觀的屏幕截圖
有人注意到同樣的問題嗎? 有任何解決辦法嗎? 項目構建良好,但未找到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'
錯誤仍然存在
更新可可豆莢可解決此問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.