0

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

Okan Kocyigit
  • 13,203
  • 18
  • 70
  • 129

1 Answers1

1

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.

Fyodor Volchyok
  • 5,610
  • 4
  • 28
  • 45