问题
I installed CocoaPods by using $ sudo gem install cocoapods
.
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
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.
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:
- Deleted and reinstall pod.
- Upgraded ruby to 2.2.1
- Delete the pods folder and re-run $ pods install.
- Clean the project.
回答1:
More a comment than an answer, but I don't have enough reputation to comment:
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.
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.
来源:https://stackoverflow.com/questions/30809206/cocoapods-pod-install-modules-cannot-be-imported