I am working on an app, which requires cocoapods. In the manual of this app is written
Add this to your Podfile:
pod 'SwiftSocket'
And run then pod install
But when I make a pod file using pod init into my folder and then open -a Xcode Podfile and there I add lines
target 'SwiftSocket' do
pod 'SwiftSocket'
end
and the last pod install it says me an error
Unable to find a target named SwiftSocket, did find SwiftSocket iOS, SwiftSocket macOS, SwiftSocket tvOS, and iOS Example.
Edit____________
Picture of my folder.
and how looks my Podfile now
It is working perfectly, check out my podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'Demo' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'SwiftSocket'
# Pods for Demo
end
Demo is the project name. Target name will be your project name.
Related
My iOS app isn't working anymore, and I have no idea what to do anymore.
I removed all pod addons, removed Podfile.lock made a pod deintegrate, made a rm -rf ~/.cocoapods/repos/trunk/, and a rm -rf /Users/antoinenedelec/Library/Developer/Xcode/DerivedData/*, and removed my .xcworkspace file.
My Podfile contains then:
# Uncomment the next line to define a global platform for your project
# platform :ios, '13.2'
target 'la soundbox' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# FIRE BASE & GOOGLE AD MOB
#pod 'Firebase/Auth'
#pod 'Firebase/Firestore'
#pod 'Firebase/Analytics'
#pod 'Google-Mobile-Ads-SDK'
end
Then I make a pod install, launched the new .xcworkspace file.
I a on deployment Target 13.2 on my target and on my project.
If I compile I have a lot of errors because I have dependencies with those project.
If I add ANY of the pod up there and make a pod install. I have dependencies error, missing package like the following:
framework not found fblpromises
34 duplicate symbols for architecture armv7
gRPC-C++ memory error xcode
Framework not found "googleutilities"...
I never have the same error.. Why can't I simply add all the pods, make a pod update and run my project ?
I'm totally lost right now.. Any Ideas ?
Try to create a new project, copy all your files with code, except pods. And then init and install your pods again.
In my react-native app I want to integrate cocoapod,after
sudo gem install cocoapods. When I create the pod file is using pod init command ,then the pod file is missing the target .
Below is the pod file code.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target ' ' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for
end
Due to this when installing pod framework ,its not working.
I do have an existing project in Xcode (swift 3) in which a detailed UI has been designed. I am still unable to install CocoaPods into that project.
All the guides I've seen on how to install cocoa pods people CREATE A NEW PROJECT and install it in that NEW PROJECT, however, I want to install it in an existing (designed UI) project. Trying to install cocoa pods in that project lead me to a workspace that shows everything empty and red lines everywhere on the left see the screenshot and suggest a solution, please. Thanks!
Please follow the below steps for installing pods to an existing project:
Open Terminal and navigate to the directory that contains your project by using the cd command:
cd ~/Path/To/Folder/Containing/Project
Next, enter the following command:
pod init
This creates a Podfile for your project.
Finally, type the following command to open the Podfile using Xcode for editing:
open -e podfile
It opens the podfile for you.
Now edit podfile to add required frameworks. it should look similar to below snippet.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectTarget' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Firebase/Messaging'
# Pods for ProjectTarget
target 'ProjectTarget-iOSSDKTests' do
inherit! :search_paths
# Pods for testing
end
target 'ProjectTarget-iOSSDKUITests' do
inherit! :search_paths
# Pods for testing
end
end
Then after pods will be integrated to the project and .xcworkspace will be created.
Next time open the .xcworkspace to continue with the project.
I am trying to install two pods to my Xcode project from terminal. I initially had installed a pod called PRAugmentedReality, and it worked fine. Then I tried adding the pod BFTransmitter, and started getting the following error message:
[!] Unable to find a specification for 'PRAugmentedReality'
If I remove the PRAugmentedReality pod and install with just BFTransmitter, it also works fine. So basically I am able to install either on their own, but not together.
My podfile looks like this:
#source for BFTransmitter
source 'https://bitbucket.org/bridgefy/bridgefypods.git'
target 'FWF' do
pod 'BFTransmitter'
pod 'PRAugmentedReality'
target 'FWFTests' do
inherit! :search_paths
end
end
I have tried repo remove master pod setup and then pod install, still no luck.
just add source to install both pods together check my podFile and add sourced before your target as I did
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
source 'https://bitbucket.org/bridgefy/bridgefypods.git'
target 'pod' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'BFTransmitter'
pod 'PRAugmentedReality'
# Pods for pod
end
Result
I encounter the same problem in my project.
When I was editing pod file, I changed pod 'SCSoftKycSolutionSdkSource' to pod 'MyprojectName'.
I fixed the below, issue fixed.
pod 'SCSoftKycSolutionSdkSource'
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