【问题标题】:Swift Error - Cannot load underlying module for 'MessageKit'Swift 错误 - 无法为“MessageKit”加载底层模块
【发布时间】: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 文件。

标签: ios swift


【解决方案1】:

根据 OP,该问题的解决方法是在构建项目之前使用 (Cmd + Shift + K) 清理项目。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-06
    • 1970-01-01
    • 2015-10-18
    • 2016-07-13
    • 2015-07-10
    • 1970-01-01
    • 2015-12-16
    • 1970-01-01
    相关资源
    最近更新 更多