没有这样的模块......在Xcode中 [英] No such module ... in Xcode

查看:121
本文介绍了没有这样的模块......在Xcode中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了Xcode(使用Swift)的问题让我完全难过。我意识到这个问题已被提出并回答,但没有一个答案对我有用,我的情况似乎与其他人有点不同,因为我的所有pod都失败了(不仅仅是一个特定的)。一周前它们都运行良好。

I've run into a problem with Xcode (using Swift) that has me completely stumped. I realize that this question has been asked and answered, but none of the answers have worked for me, and my situation seems to be a bit different than the others, as all of my pods are failing (not just a specific one). They all worked fine a week ago.

我将Cocoapods用于一些比较常见的Swift框架(例如Alamofire,Eureka,Kingfisher,SwiftyJSON等)。它们在Xcode 7中都运行良好。但是,其中一个(自动)更新增加了我的Xcode版本,之后必须在podfile中指定你的目标。我做了这个并运行pod安装。 pod仍然存在,但现在每个与这些框架相关的import语句都失败了。

I use Cocoapods for some of the more common Swift frameworks (e.g. Alamofire, Eureka, Kingfisher, SwiftyJSON, etc.). They were all working fine in Xcode 7. However, one of the (automatic) updates bumped up my Xcode version, after which it became mandatory to specify your target in the podfile. I did this and ran pod install. The pods are all still there, but now every import statement that relates to these frameworks fails.

起初我认为这是一个Alamofire问题,因为那是第一个失败了没有这样的模块'Alamofire'错误。我尝试了Alamofire的一切,包括以下内容:

At first I thought it was an Alamofire issue, as that's the first one that failed with the "No such module 'Alamofire'" error. I tried everything I could with Alamofire, including the following:


  • 清理和重建

  • 清洁构建文件夹

  • 重新启动Xcode

  • 重新启动计算机

  • 删除所有派生数据

  • 为链接的框架和库添加了框架

  • 添加了将二进制文件链接到库的框架

  • 已验证我正在打开工作区而不是项目

  • 重新安装CocoaPods

  • 重新安装Xcode ver 7.3.1

  • Clean and rebuild
  • Clean build folder
  • Restart Xcode
  • Re-boot computer
  • Delete all derived data
  • Added framework to "Linked Frameworks and Libraries"
  • Added framework to "Link Binary with Libraries"
  • Verified that I am opening the workspace rather than the project
  • Re-installed CocoaPods
  • Re-installed Xcode ver 7.3.1

什么都不会删除没有这样的模块...错误。最后,我从舱中删除了Alamofire,并将Alamofire项目拖入了我的项目。这允许我删除Alamofire的import语句。但令我沮丧的是,现在下一个框架导致没有这样的模块。我将接下来的三个框架移动到我的项目中,看起来它只是继续前进。显然,我的Pods框架都没有被识别出来了。我安装了Xcode 8并尝试使用Swift 2.3,但我得到了相同的没有这样的模块错误。

Nothing would remove the "No such module ..." error. Finally, I removed Alamofire from the pods and just dragged the Alamofire project into my project. This allowed me to remove the import statements for Alamofire. However, to my dismay, now the next framework caused "No such module". I moved the next three frameworks into my project, and it looks like it is just going to keep going. Apparently, none of my Pods frameworks are being recognized anymore. I installed Xcode 8 and tried that with Swift 2.3, but I get the same "No such module" errors.

我真的更喜欢使用Cocoapods,因为它会进行升级更容易,以及其他奖金。我猜我有一些设置错误,搞砸了我所有的豆荚,但没有找到任何运气。这有点像一场灾难,因为它已经关闭了几天的开发,没有任何修复的迹象。如果有什么我可以做或提供帮助找到解决方案,请告诉我。如果有人可以提供任何可能的解决方案甚至是尝试的东西,我们将不胜感激。我目前正在使用Xcode版本7.3.1。

I really would prefer to use Cocoapods, as it makes upgrades a lot easier, along with other bonuses. I'm guessing I have some setting wrong that is screwing up all my pods, but have not had any luck finding it. This is a bit of a disaster as it has shut down development for several days, with no sign of a fix. If there is anything I can do or provide to assist in finding a solution, just let me know. If anyone could provide any possible solutions or even things to try, it would be greatly appreciated. I'm currently working with Xcode version 7.3.1.

我的pod文件如下所示:

My pod file looks something like this:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'Y2GOsp' do
    use_frameworks!

    # Pods for Y2GOsp
    pod 'Alamofire', '~> 3.0'
    pod 'AlecrimCoreData', '~> 4.0'
    pod 'Kingfisher', '~> 2.4'
    pod 'Eureka', '~> 1.6'
    pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode7'
    pod 'PhoneNumberKit', '~> 0.1'
    pod 'PKHUD'
    pod 'Dollar'
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '2.2'
        end
    end
end


推荐答案

来自@ l'L'l的评论引导我找到解决方案。我去了

Comments from @l'L'l led me to the solution. I went to

build settings > frameworks search path

并将其设置为以下内容:

and set it to the following:

$(inherited) (non-recursive)
$(PROJECT_DIR)/build/Debug-iphoneos (non-recursive)
$(SRCROOT) (recursive)

现在可以正确找到pod框架。

It is now correctly finding the pod frameworks.

这篇关于没有这样的模块......在Xcode中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆