【发布时间】:2017-11-11 01:47:00
【问题描述】:
我一直在尝试使用 MessageKit 创建聊天应用程序,但是在创建 ViewController 并导入 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.
}
}
【问题讨论】:
-
你运行 pod install 了吗?
-
是的,我已经运行了 pod install
-
愚蠢的问题,抱歉:运行
pod install后,您打开的是xcworkspace文件还是xcodeproj文件?您应该打开工作区。 -
首先排除的常见修复 - 1) 确保打开工作区文件(如 huwr 建议的那样)。 2)做一个干净的(Cmd + Shift + K)然后为通用iOS设备构建(Command + B)。
-
@huwr 我在运行 pod install 后打开了 xcworkspace 文件。