'No such module' when I use CocoaPods

Idris picture Idris · Jun 26, 2015 · Viewed 66.3k times · Source

So here's my procedure. I create a new Podfile in the project directory, then I added the following

platform :ios, '9.0'
use_frameworks!

target 'CPod' do
pod 'AFNetworking', '~> 2.5'
pod 'ORStackView', '~> 2.0'
pod 'SwiftyJSON', '~> 2.1'
end 

I fire off pod install, and everything goes well, open up the xcworkspace. I then go over to ViewController.swift and if I try to import a pod I get No such module 'SwiftyJSON', if I were to do import SwiftyJSON. Any ideas?

EDIT: SwiftyJSON is a Swift based module, not Obj-C

Answer

Micah Benn picture Micah Benn · Jun 9, 2016

Try adding the Pods framework to your build scheme and building the framework. After you've built it, build/run your project.

Steps:

  1. Scheme menu > Manage Schemes > check Pods > Close manage

    enter image description here

  2. Select Pods from the scheme menu.
  3. Build Pods.
  4. Select your project from the same menu, then build/run it.