【问题标题】:No such a module error on TodayViewControllerTodayViewController 上没有这样的模块错误
【发布时间】:2017-01-08 13:36:29
【问题描述】:

我有一个额外的目标,即今天的小部件。我正在尝试向此目标添加一些 pod,但是当我尝试导入模块时,我没有得到这样的模块“xxx”,顺便说一下它正在处理我的主要目标。这是我已经完成的,

播客文件

target 'My-Project' do
    use_frameworks!
    pod 'SwiftyUserDefaults'
    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'
end

target 'My-Widget' do
    use_frameworks!
    pod 'SwiftyUserDefaults'
    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
        end
    end
end
  • pod 安装没有错误。
  • .xcworkspace 打开的项目
  • pod --version 是 1.0.1
  • 我已多次清除派生数据、清理项目、重新打开项目和重建项目。

我怎样才能让它工作?

结果是

【问题讨论】:

  • 你确定 alamofire 工作正常吗?
  • @FyodorVolchyok,不,它也不起作用。但他们都为主要目标工作。
  • 如果我是你,我会先尝试将 cocoapods 更新到最新版本(据我所知为 1.1.1),然后尝试从头开始重新安装 pod(甚至可能使用 pod deintegrate)。跨度>
  • 顺便说一句,你在一个干净的空项目上试过了吗?
  • @FyodorVolchyok,不。让我尝试更新 cocoapods 并在一个干净的项目上尝试一下。

标签: swift xcode cocoapods ios10-today-widget


【解决方案1】:

好像 cocoapods 版本有点过时了。在某些情况下(尤其是考虑到不断变化的 swift、xcode 和 cocoapods)可能会导致令人沮丧的后果。幸运的是,通过更新 cocoapods 很容易解决这个问题。

【讨论】:

    猜你喜欢
    • 2021-08-04
    • 2016-01-04
    • 2015-11-12
    • 1970-01-01
    • 1970-01-01
    • 2018-09-23
    • 2023-03-16
    • 1970-01-01
    • 2019-10-31
    相关资源
    最近更新 更多