CocoaPods吊舱安装。无法导入模块 [英] CocoaPods pod install. Modules cannot be imported
问题描述
我使用 $ sudo gem install cocoapods
安装了CocoaPods。
I installed CocoaPods by using $ sudo gem install cocoapods
.
我有一个快速的Xcode项目,以下podfile
I have a swift Xcode project with the following podfile
platform :ios, '8.2'
use_frameworks!
target 'Clover' do
pod 'Alamofire', '~> 1.2'
pod 'SwiftyJSON', '~> 2.2'
pod 'ObjectMapper', '~> 0.12'
pod 'ImageLoader', '~> 0.3.0'
pod 'SVProgressHUD'
end
target 'CloverTests' do
end
运行Pod install(似乎运行正确,没有错误消息)后,我有一个 Pods 由
Pods.xcodeproject
和其他几个文件生成的code>文件夹。
After I run pod install, which seems to run correct with no error messages, I have a Pods
folder generated with Pods.xcodeproject
along with several other files.
但是,当尝试编译项目时,我将陷入错误,告诉我找不到我的模块。错误消息是没有这样的模块
,后跟模块名称。
However, when attempting to compile the project, I will into errors telling me my modules are not found. The error message is No such module
followed by the module name.
然后,我尝试手动安装模块并确认手动安装后,pod确实不能作为每个模块正常工作。
I then attempted to install the modules manually and confirmed that the pods are indeed not working as each module after its manual installation, works.
我已经搜索并尝试了以下几种解决方案:
I have searched and attempted several solutions as follows:
- 删除并重新安装吊舱。
- 将红宝石升级到2.2.1
- 删除pods文件夹并重新运行$ pods安装。
- 清理项目。
- Deleted and reinstall pod.
- Upgraded ruby to 2.2.1
- Delete the pods folder and re-run $ pods install.
- Clean the project.
推荐答案
评论多于答案,但我没有足够的声誉来评论:
More a comment than an answer, but I don't have enough reputation to comment:
当您使用带有
,它将创建一个名为 your-project.xcodeproject
的pod install your-project.xcodeworkspace (
…项目
变为…工作区
),这是您应该打开的新文件。
When you use pod install
with your-project.xcodeproject
, it creates a new file/folder named your-project.xcodeworkspace
(…project
becomes …workspace
) and this is this new file that you should open.
您没有提到您是否知道,所以就到这里:关闭 .xcodeproject
Xcode并打开 .xcodeworkspace
,它应该可以工作。
You didn't mention whether or not you knew that, so here you go: close the .xcodeproject
in Xcode and open the .xcodeworkspace
instead and it should work.
这篇关于CocoaPods吊舱安装。无法导入模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!