library not found after cocoapods integration - ios

Integrated (objective C) Xcode 7.2 iOS 9.2:
$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoa pods (automatic pods version (0.39))
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ cd/ to project folder
$ pod init
$ open -a Xcode Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'ProjectName' do
pod 'AFNetworking', '~> 2.0.3'
end
target 'ProjectNameTests' do
end
$ pod install
Xcode gives error "library not found for -lAFNetworking"
Searched around google: Tried with things:
Removed everything from target>build setting>otherlinkerflag, except $(inherited), compiled but unlucky
Deintegrated pods plugin from (https://github.com/CocoaPods/cocoapods-deintegrate) again installed compiled but unlucky
Tried experiment with header search path & framework search path but unlucky.

Did you open Workspace or Project file? Verify that you open first one

Make Sure Pods is completely instally !!!
and open Workspace file geneterated after pods is installed !!

Related

How do I access cocoa pods library and add a module to it?

I am using macincloud to do some xcode work and I have a xcode package that works fine on the computer it was made on, but in macincloud I get a no module error. How do I check on my pod library, is it part of the of the computer or is part of my code?
I have read about opening up terminal and typing in different commands to install pods but nothing is working
Here is what is in my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'WallpaperBoard' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'IQKeyboardManagerSwift'
pod 'Google-Mobile-Ads-SDK'
pod 'DBImageColorPicker'
pod 'SSUIViewMiniMe'
# Pods for WallpaperBoard
end
Cocoapods is a dependency manager. Running the pod install command on Terminal, it downloads all the Pods as external dependencies and creates a .xcworkspace for your project.
It needs to be run once in every different computer you run your project.
On Mac In Cloud:
Open Terminal
Navigate to the project folder, where the Podfile is. Usually you can navigate with the cd command. Example:
cd /Users/user_name/Desktop/project_folder
Run the command to install the Pods:
pod install
Open the generated .xcworkspace file

Pods not installing properly

I had been installing pods and the pods get installed properly . However , in the Project navigator , the .xcconfig files are red in color and I cannot set the same in the project-> info -> configurations either as they don't get listed and only none is listed. When debugged , I could find that the .xcconfig files were getting accessed by the xcode in the following path
/Volumes/Macintosh HD/Users/xxxxxxxxxx/Documents/xxxxxxxx/app/Pods/Pods/Target Support Files/Pods-broadcastuploadSetupUI/Pods-broadcastuploadSetupUI.release.xcconfig
/Pods is there twice , Because of which I am getting the following errors :
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I am working with Xcode 9 beta . Can anyone kindly help ?
P.S , I have tried sudo gem install , pod update , disintegrate , install and everything that is available on the internet as a solution. I'd be glad if anyone could help
This is my podfile :
#platform :ios, ‘11.0’
source 'https://URL_TO_ACCESS_PODSPEC_FOR_POD'
source 'https://github.com/CocoaPods/Specs.git'
target 'app' do
pod 'objective-zip', '~> 1.0'
pod 'AssistScreenShareKit'
use_frameworks!
end
target ‘broadcastupload’ do
pod 'AssistScreenShareKit'
use_frameworks!
end
target ‘broadcastuploadSetupUI' do
pod 'AssistScreenShareKit'
use_frameworks!
end
Error :
The file “Pods-app.release.xcconfig” couldn’t be opened because there is no such file. (/Volumes/Macintosh HD/Users/xxxxxxxx/Documents/xxxxx/app/Pods/Pods/Target Support Files/Pods-app/Pods-app.release.xcconfig)
Steps to install pod
Open a terminal window, and $ cd into your project directory.
To create a Podfile you need to to run $ pod init.
Open your Podfile. The first line should specify the platform and
version supported.
platform :ios, '9.0'
use_frameworks! target 'yourProjectName' do
pod 'Alamofire' end
Then install the pod
pod install
First delete all pods and Podfile.lock
open terminal and go to folder path
Edit your podfile by this
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
//add your all pods
end
pod install
close xcode and open MyApp.xcworkspace file
check for more: Command-line Reference
This will help you.
update your Cocoapods version, I had this problem with Cocoapods 1.5.3 and it was fixed in 1.6.1
to do that open terminal and just type
gem install cocoapods

How to add cocoapod to ios framework

I am working on ios project, where I am using EVReflection library in project,I am having one custom framework there I am using EVReflection for that I have taken cocoapod i added after that I am trying to build framework it is not building and one more my project is also using Evreflection so if I add my custom framework to project will it add automatically import Evreflection there also.
SampleFramwork i am adding evreflection
code:
platform :ios, '9.0'
target 'SampleFramework' do
use_frameworks!
pod "EVReflection"
end
Install POD
[ 1 ] Open terminal n type:
sudo gem install cocoapods
Gem will get installed in Ruby inside System library. Or try on 10.11 Mac OSX El Capitan, type:
sudo gem install -n /usr/local/bin cocoapods
If there is an error "activesupport requires Ruby version >= 2.xx", then install latest activesupport first by typing in terminal.
sudo gem install activesupport -v 4.2.6
[ 2 ] After complete installation, there will be a lot of messages, read them and if no error found, it means cocoapods installation is done. Next, you need to setup the cocoapods master repo. Type in terminal:
pod setup
And wait it will download the master repo. The size is very big (370.0MB at Dec 2016). So it can be a while. You can track of the download by opening Activity and goto Network tab and search for git-remote-https. Alternatively you can try adding verbose to the command like so:
pod setup --verbose
[ 3 ] Once done it will output "Setup Complete", and you can create your XCode project and save it.
[ 4 ] Then in terminal cd to "your XCode project root directory" (where your .xcodeproj file resides) and type:
pod init
[ 5 ] Then open your project's podfile by typing in terminal:
open -a Xcode Podfile
[ 6 ] Your Podfile will get open in text mode. Initially there will be some default commands in there. Here is where you add your project's dependencies. For example, in the podfile, type
pod 'EVReflection'
(this line is an example of adding the AFNetworking library to your project).
Other tips:
Uncomment platform :ios, '8.0' Uncomment user_frameworks! if you're using Swift
When you are done editing the podfile, save it and close XCode.
[ 7 ] Then install pods into your project by typing in terminal:
pod install
Depending how many libraries you added to your podfile for your project, the time to complete this varies. Once completed, there will be a message that says
"Pod installation complete! There are X dependencies from the Podfile and X total pods installed."
Now close your xcode project and open .xcworkspace xcode project file and start coding. :)
Configuration should look something like this:
1) Open terminal and locate your project root
2) write: pod init
3) write: atom podfile (or nano/vim/some other texteditor)
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
# Public spec repository
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'ProjectName' do
# Pods for ProjectName
pod 'EVReflection'
end
4) write: pod install
5) close all of your current xcode projects, and open project.xcworkspace file
Use the format below in Podfile
use_frameworks!
target "YourProjectName" do
pod 'EVReflection'
end
If it is not building yet , add it to Embedded Binaries and Linked Frameworks and Libraries

How to create a CocoaPod with swift?

I create a swift cocoa touch framework according to create cocoapod with siwft
and it works fine, But there is another problem, my framework will dependency on other framework, such as SwiftyJSON.
And I try add
s.dependency "SwiftyJSON", "~> 2.3"
into the .podspec file.
But when I try to build my 'Example', still error happens :
'No such module SwiftyJSON'
Open your terminal and goto to your folder project. Then follow this step. Type this command in your terminal.
open -a TextEdit Podfile
Then copy this pod 'SwiftyJSON', :git =>'https://github.com/SwiftyJSON/SwiftyJSON.git'
put into Podfile. Then save it. And type this command in your terminal.
pod install
Hope it will help you.
First you should install cocoapods package in your mac
check this tutorial to do this How to install cocoapods?
Then you can install any cocoapods for any project by the following steps
open terminal
navigate to the root path for the project, example
cd /Users/mac/Desktop/cocoatest
then type
pod init
(the will generate file "Podfile" ) open it
the content for this file will be something like this:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'cocotest' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for cocotest
end
uncomment this line # platform :ios, '9.0'
and then add you cocoapods under this line
# Pods for cocotest
like
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'cocotest' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for cocotest
pod "SwiftyJSON", "~> 2.3"
end
then save the file
after that type pod install in terminal and it will create file with
xcworkspace extension open it and that is your project

Alamofire "installation" not working (red text in Embedded Binaries)

I am trying to add Alamofire to my xcode v6.3.2 project but it's not working for me. I followed all the steps in the readme from the github repo but when I select the framework to add as an "Embedded Binary" it shows with red text and is not available to me in code.
Does anyone know why this might be? I also tried to add to a brand-new, blank project with the same results.
I'd advise you to use CocoaPods. Here is how you do that:
First get Brew. Open up a terminal and paste this in there:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then get CocoaPods. To do that run this command in the same terminal:
sudo gem install cocoapods
After you've done that navigate to your Xcode project in the terminal (be sure to replace YourProjectHere with your project's name):
cd ~/Documents/XcodeWorkspace/YourProjectHere
In this folder run the command:
pod init
After running pod init a file will have been created called: Podfile. Edit this file by typing:
vi Podfile
At first this file will contain:
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'YourProject' do
end
target 'YourProjectTests' do
end
Edit it to contain this:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
use_frameworks!
target 'YourProject' do
pod 'Alamofire', '~> 1.2'
end
target 'YourProjectTests' do
end
Now completely exit out of Xcode and run this command in terminal:
pod install
Last but not least! Type the following command:
open YourProjectHere.xcworkspace
Everything should be up and running! Make sure to include the following in the class where you'd like to use the Alamofire framework:
import Alamofire
I followed the instructions posted in the Alamofire page and you're right it happens , but even it works too.
Just build the project, and then you can put import Alamofire and make requests without problem.
I hope this help you.

Resources