2017-11-11 17 views
1

我一直在嘗試使用MessageKit創建一個聊天應用,但在創建視圖控制器時,導入MessageKit底層模塊,我得到一個錯誤,如下斯威夫特錯誤 - 無法載入「MessageKit」

無法加載 'MessageKit' 底層模塊

這是我PodFile

platform :ios, '11.0' 

target 'GanChat' do 
use_frameworks! 

pod 'Firebase/Core' 
pod 'Firebase/Storage' 
pod 'Firebase/Auth' 
pod 'Firebase/Database' 
pod 'MessageKit' 

end 

,這是我的ViewController

import UIKit 
import MessageKit 

class ChatViewController: MessagesViewController { 

override func viewDidLoad() { 
    super.viewDidLoad() 
    // Do any additional setup after loading the view, typically from a nib. 
    senderId = "1234" 
    senderDisplayName = "Heri" 
} 

override func didReceiveMemoryWarning() { 
    super.didReceiveMemoryWarning() 
    // Dispose of any resources that can be recreated. 
} 
} 
+1

您是否運行pod安裝? –

+0

是的,我已經運行pod安裝 – rafitio

+0

愚蠢的問題,對不起:運行'pod install'後,你打開'xcworkspace'文件或'xcodeproj'文件?你應該打開工作區。 – huwr

回答

1

根據OP,解決該問題的方法是在構建項目之前用(Cmd + Shift + K)清理項目。