I'm trying to import JSQMessagesViewController:
import JSQMessagesViewController
And it gives me the error 'no such module'. I've seen many people with this problem on the web but I can't find the solution. Here's my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, ‘9.2’
# Uncomment this line if you're using Swift
use_frameworks!
target ‘IXODES’ do
pod 'JSQMessagesViewController'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
end
I've tried cleaning the build, also pod deintegrate and then pod install and pod update. Nothing works and I can see the library in my project like the rest. Any help?
perhaps you tried to import the file and the file is missing by any chance,
a few things you can do.
you can clean the project from cocoapods and re-install cocoapod(this helped me onetime i got the same problem the file were missing) you can do that by
run this code on the terminal
[sudo] gem install cocoapods-deintegrate
once done
cd your file
and then run thispod deintegrate
then you're all set! and re install it
---- another solution ---
try these
1-Adding all of the .frameworks to the Projects Build Phases -> Link Binary With Libraries
2-Selecting each framework and building it. You can do this by selecting your project name next to the run arrow.
3-Cleaning the project and restarting my computer.
hope it helps
I'm using Xcode 7 for ios development. I'm new to Swift. I use in my project CocoaPods. But I'm unable to import the files into our project.
MY Cocoapodfile is
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'SCLAlertView2' do
pod 'SCLAlertView'
end
target 'IceCreamShopTests' do
end
Podfiles are created. But I'm unable to import the files.
import SCLAlertView
I'm getting no such module error getting. How to resolve it. Any help welcome.
Not only podfile has to be created, you also have to run
pod install
Or, if you already installed and you want to update/add new libraries:
pod update
Then, build the project again (Command+B)
Follow the "Getting Started" instructions at cocoapods.org. Here are the specific steps listed:
List the dependencies in a text file named Podfile in your Xcode project directory:
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
Tip: CocoaPods provides a pod init command to create a Podfile with smart defaults. You should use it.
Now you can install the dependencies in your project:
$ pod install
Make sure to always open the Xcode workspace instead of the project file when building your project:
$ open App.xcworkspace
Now you can import your dependencies e.g.:
#import <Reachability/Reachability.h>
I followed the instruction of Alamofire in github,
I created an xcode project named cocoapods-test & I closed it.
I go to the project folder run pod init command which generates a Podfile. Then I added the following code to the Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
Then, I run command pod install and this is the result in terminal:
Updating local specs repositories
CocoaPods 1.0.0.beta.6 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
Downloading dependencies
Installing Alamofire (3.3.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `cocoapods-test.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Then, in my project folder there is a new file called cocoapods-test.xcworkspace . I double clicked it which opens my xcode again, and I can see the Alamofire module.
Then, I opened my project's ViewController class, and import Alamofire . But no matter how many times I clean & build, I always get error No such module 'Alamofire' . Here is the screenshot:
Why I get this problem though I followed the instruction step by step?
(I am using XCode 7.2.1, Swift 2.1.1 & Alamofire 3.3.0)
======= UPDATE ========
I tried #LK Yeung 's answer, uncomment import Alamofire, then clean & build again, I got a bunch of compiler errors from Alarmofire:
You need to build the project successfully once before using the library
comment import Alamofire -> build -> uncomment import Alamofire
Make sure you have opened the "project_name".xcworkspace instead of "project_name".xcodeproj .As you are working on pods all the installed pod will be available only in your .xcworkspace project file.
I was having this exact same problem. Please make sure that you are on Xcode 7.3 and using Swift 2.2.
You can check your Swift version using xcrun swift -version. Updating Xcode to 7.3 should also automatically update Swift.
Updating Xcode resolved this issue for me.
You need to add the lib to 'the Link Binary With Libraries' section also
You can try put pod 'Alamofire', '~> 3.0' like below. And run pod install again.
target 'yourtarget' do
pod 'Alamofire', '~> 3.0'
end
If you're manually installing Alamofire (or any other framework) make sure your build configurations match between both your parent project and the sub project. For example, if your build configuration in your project is called 'Development', but Alamofire's is called 'Debug' you'll get the 'no such module' error.
Follow This Sequence
➼ Open Terminal, go to the project folder and run these commands:
sudo gem install cocoapods -n /usr/local/bin
pod install
➼ Go to this link and clear derive data folder:
~/Library/Developer/Xcode/DerivedData
➼ Then open project "xcworkspace" file and press:
Command + Shift + K
➼ and then:
Command + B
It should work now
Cheers!
try to latest updated install alamofire and also check u use alamofire latest is this in your xcode supported.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.4'
end
try this above alamofire on your podfile
I had the same issue, the reason was that I installed the wrong version of alamofire.
I am using Xcode 7.3, swift 2.2, so alamofire 3.0 worked for me
remove the library using these steps mentioned by #Michal
Remove or uninstall library previously added : cocoapods
Then in your pod file
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘9.3’ <-- your target version
use_frameworks!
target ’<your target name>’ do
pod 'Alamofire', '~> 3.0’
end
No such module 'Alamofire' Error
because you have not installed the Alamofire in your pod file
open Podfile and add this line
pod 'Alamofire'
double-check in Podfile if this line already is written then no need to write. then just update pod file
for updating your pod open your Podfile into terminal and dial
pod update
I am trying to use the cocoapod Alamofire in Swift. However, I get the error "No Such Module" when I Import Alamofire I am using Xcode 7.2 Alamofire 3.0 and Swift 2 The following are the steps I took
1) In terminal I ran
$ sudo gem install cocoapods
There were no errors then
2) I ran
cd ~/Path/To/Folder/Containing/Project (once in the project folder I ran)
pod init
3) Then
open -a Xcode Podfile
4) Then I added
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
to the Podfile
5) Then I ran
pod 'Alamofire', '3.0'
followed by
pod install
I added $(SRCROOT) to runpath and buildpath.
Also I found this answer No such module "Armchair" saying to add the pre-release but I don't really understand how to do this or if this is my problem. Maybe this is obvious ,however I'm new to Swift and am not understanding.
Also should Alamofire show up in my frameworks, or pods folder? It isn't in either.
files in project
After pod init you must use the new <YourProject>.xcworkspace instead of <YourProject>.xcodeproj.
The xcworkspace contains your project and your pods after pod install.
I am using xcode 6.4 in my project, it contains cocoapods where Pods are as follows:
pod 'ZXingObjC', '~> 3.0'
pod 'Google-Mobile-Ads-SDK'
pod 'iRate'
pod 'NewRelicAgent'
pod 'GoogleAnalytics'
pod 'Appirater'
pod 'Crashlytics'
But, after I update my pods I am getting the error which I attached to this image: Error is becuase of one pod
Need One project prefix header file
And add in bulid setting this .pch file.
So
FOR OBJECTIVE_C
yes this podfile should work,
FOR SWIFT add,this line too
use_frameworks!
YOU DON'T HAVE TO MENTION THE VeRSION OF ANY LIBRARY IF NOT MENTIONED ON COCOAPODS.
Lastly if you have taken care of all these
then try cleaning project cmd
+ shift+ k and then run project.
If still not working then delete manually the dependencies folders and reinstall them
# if there is problem with Google MobileAds-ios-Sdk, then you are stuck. Because there is some problem with them, and hence it would be better to install Google MobileAds-ios-Sdk manually only