No such a module error on TodayViewController

242 views Asked by At

I've an extra target which is a today widget. I'm trying to add some pods to this target, but I'm getting no such a module 'xxx' when I try to import a module, by the way it's working on my main target. here is what I've already done,

podfile

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 installed with no error.
  • project opened by .xcworkspace
  • pod --version is 1.0.1
  • I've cleared derived data, cleaned project, reopened project and rebuild project several times.

How can I make it work?

And the result is enter image description here

1

There are 1 answers

0
Fyodor Volchyok On BEST ANSWER

Seems like cocoapods version is a bit outdated. In some cases (especially considering constantly changing swift, xcode and cocoapods) it might lead to frustrating consequences. Fortunately, this one was easy to fix by updating cocoapods.