How to add cocoapod to ios framework - ios

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

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

How to create app store app update notification mechanism using Swift 4.2?

My scenario, I am trying to Implement app update notification for my application. I tried Siren Pod but It is showing no module found. Please provide me a solution or alternative ideas.
Siren Pod
Siren Link
Here, i am getting No Module Found after pod installation also.
Import Siren // No module found
Did you open your .xcworkspace or .xcodeproj? This error message is one that you’d get if you accidentally opened the .xcodeproj.
Following the Siren installation instructions for cocoapods, you’d do something like the following in your “Terminal” window. Specifically, if you hadn’t created the Podfile yet:
$ cd MyApp
$ pod init
And you can edit your Podfile, something like:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Siren'
end
Then you can do can install your Cocoapods from the “Terminal”:
$ pod install
Analyzing dependencies
Downloading dependencies
Installing Siren (4.2.1)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MyApp.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] Automatically assigning platform `ios` with version `12.1` on target `MyApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Note the warning:
Please close any current Xcode sessions and use MyApp.xcworkspace for this project from now on.
And now open the workspace, not the .xcodeproj:
$ open MyApp.xcworkspace

The dependency `Mixpanel` is not used in any concrete target

I'm trying to add mixpanel plugin into my react-native project.
I'm using these links
react-native-mix panel github
and the integration in xcode is here
mixpanel cocoapods
I followed these instructions:
Install CocoaPods using gem install cocoapods
If this is your first time using CocoaPods, run pod setup to create a local CocoaPods spec mirror.
Create a file in your Xcode project called Podfile and add the following line: pod 'Mixpanel'
Run pod install in your Xcode project directory. CocoaPods should download and install the Mixpanel library, and create a new
Xcode workspace. Open up this workspace in Xcode.
gem install cocoapods
then I run pod setup and create Podfile text file into the project.
then when I run pod install into my bash command line i get this error
The dependency Mixpanel is not used in any concrete target.
You first need to run pod init from your react native ios directory. This generates the correct starting podfile, targeting your app correctly.
https://github.com/facebook/react-native/issues/7775
I was getting the above error.
So I added the Text file in podfile in below format:
target "MercadoPagoSample" do
source 'https://github.com/CocoaPods/Specs.git'
# Se necesita este parámetro por ser una SDK en swift
use_frameworks!
platform :ios, '9.0'
pod 'MercadoPagoSDK', '3.6.0'
end
Then I was able to update the podfile.

Always get build error : No such module 'Alamofire'

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

library not found after cocoapods integration

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 !!

Resources