Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
jon kelson
5,149 PointsSwiftyJSON , No such module ! ? Please help
Just installed Alsmofire which works fine in project.
BUT I installed SwiftyJSON into my Pod file and it won't recognise it in my Xcode project it's saying no such Module ! Even though there is all the files Showing .
6 Answers
Kevin Elliott
15,653 PointsIn order for your new module to work you need to:
- Add the library to the Podfile (you have done this already)
- Install the pod dependencies and specified libraries by running
pod install - Re-open the project in Xcode using the xcworkspace file with
open Project.xcworkspace
Opening with the project file will fail to see the pod integrations.
jon kelson
5,149 PointsMany thanks Kevin will do ???
jon kelson
5,149 Pointshi Kevin just to let you know this is the message I'm getting back when i try to install pod .
No `Podfile' found in the project directory.
Kevin Elliott
15,653 PointsOK. Just to knock out the obvious, do you have your pod file named Podfile and in the current directory where you are running `pod install from?
Another thing. You want to have the Podfile one directory up next to the Project.xcodeproj and Project.xcworkspace. All three should be in the same parent folder. And it is from this path that you run pod install since it will modify the xcworkspace to contain the new dependencies.
jon kelson
5,149 Points// Hi Kevin sorry to bother you with this . I just want to crack this . this is my pod file. not sure if I have to change the target ,or I'm not sure what I'm supposed to do . any chance of an idiots guide for me. lol.
Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'newfire' do # Comment this line if you're not using Swift and don't want to use dynamic frameworks use_frameworks!
# Pods for newfire
pod ‘Alamofire’, ‘~> 3.0’
pod 'SwiftyJSON'
pod 'Alamofire-SwiftyJSON'
end
jon kelson
5,149 Pointshi kevin, yes its called pod file but where It says "where" at the top under Tags, I've just realised its going to an old project so ill set up a new project and change the "where" name . just for staters
ill let you know how I get on . many thanks
jon kelson
5,149 Pointsok I think I've got it . I need to create a new pod file for every new project and it seams to work now . I was trying to use the same old one for a new project .
I also managed to install Alamofire and SwiftyJSON in one hit ! just like this pod 'Alamofire-SwiftyJSON'
hopefully ill be ok now . thanks again for your help .
Kevin Elliott
15,653 PointsYes, exactly. A Podfile for each project. And you put that file in the same folder as the xcodeproj folder. You're welcome, glad you got running!
jon kelson
5,149 Pointsjon kelson
5,149 PointsThanks Kevin I'll try that . I. Think I tried it before and it shows all the files in the Xcode project but... It still was saying no module after I wrote in import SwiftyJSON and ran it. I won't give up . It's probably something very simple I'm doing wrong that Someine like you would know straight off .?? but I will try starting it over again and running pod install . Many thanks
Kevin Elliott
15,653 PointsKevin Elliott
15,653 PointsYou're welcome Jon! If you're still struggling after trying these things, come back and tell me what happened (details are helpful). Or you can ask a new question.