问题
This question is already asked here But no answers work for me. I have tried all the ways which are mentioned below.
- Open project using .xcworkspace
- Deleted all the pod related file from project and again pod install even updated the cocoa pods.
- Added $(inherited) flag in Other Linker Flags. and -ObjC also, so it may find path from pod framework.
- Added bridging file to import SDWebImage.
- Deep clean, build every time and restart the project.
I am checking all scenario since 4 to 5 hours but I am not getting the exact reason why this is happening.
Below is my Pod file.
platform :ios, '12.0'
use_frameworks!
target 'ProjectName' do
pod 'Alamofire'
pod 'SDWebImage'
end
回答1:
This happened to me many times try these steps:
-> Try cleaning your project
OR
-> Restart your Xcode
OR
-> If you doing a new project
setup than try again new project
again
- delete your
workspace
- again create your new workspace with
pods
installing from fresh - try to
rebuild
3rd option could work as this happens many times when search paths
are not getting in build settings
of your project
回答2:
SDWebImage
is a Swift pod depending on Objective-C, which is different than Alamofire
, and needs one extra step:
- For
CocoaPods 1.5.0+
(andXcode 9+
):
Add:modular_headers => true
to the line of package name, like:
# For CocoaPods after 1.5.0
target 'ProjectName' do
pod 'Alamofire'
pod 'SDWebImage', :modular_headers => true
end
- For earlier versions:
Add or uncommentuse_frameworks!
in the Podfile, like
# For CocoaPods before 1.5.0
target 'ProjectName' do
use_frameworks!
pod 'Alamofire'
pod 'SDWebImage'
end
Finally, to apply the change, please
- Close Xcode
- Run
pod update
in the project folder - Open the
.xcworkspace
file in Xcode again.
Reference:
SDWebImage Installation Guide
CocoaPods 1.5.0 — Swift Static Libraries
回答3:
Start Fresh
- Open terminal
- Drag Path Of your Project
- Create Podfile add the required dependencies
- pod install
- Open Workspace
- Locate SDWebImage.framework in products including support files
- DO Show in Finder for SDWebImage.framework. copy the framework and use it any where
回答4:
Make sure that your podfile does not have frameworks commented "#"
If not, you still need to add use_frameworks! to use SDWebImage as dynamic framework:
platform :ios, '8.0' use_frameworks! pod 'SDWebImage'
Close Xcode. Erase the line import SDWebImage. Open terminal -> cd your folder -> pod update -> close terminal -> open workspace and now import SDWebImage
来源:https://stackoverflow.com/questions/54683959/no-such-module-sdwebimage-using-pod