cocoa pods not working - swift

I have a newly created project, which I used
pod init
on to initialize cocoa pods
Im adding a single pod (TCPickerView ) to it and trying to use it but getting errors
podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Symphony' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'TCPickerView'
# Pods for Symphony
target 'SymphonyTests' do
inherit! :search_paths
# Pods for testing
end
target 'SymphonyUITests' do
inherit! :search_paths
# Pods for testing
end
end
I do
pods install
then open the Symphony.xcworkspace file and build
Then I add the example code from the TCPickerView site (see second screenshot which shows code and errors).
screenshot showing the pods library is included in the Symphony project
screenshot with code and error

There is no problem with your podfile, I tried it works, I guess you are missing import TCPickerView
It goes right after import UIKit in class ViewController

Can you update your pod file
platform :ios, '9.0'
use_frameworks!
target 'Symphony' do
pod 'TCPickerView'
target 'SymphonyTests' do
inherit! :search_paths
# Pods for testing
end
target 'SymphonyUITests' do
inherit! :search_paths
# Pods for testing
end
end
and try like this and reinstall pods again : pod install
Usage: import TCPickerView

Related

How do I hide or remove warnings for a specific pod dependency?

I am using the Firebase/Remote config pod and that pod depends on a pod called Protobuf
Which has a lot of warnings.
My pod file
platform :ios, '10.0'
target 'AppeeUITests' do
use_frameworks!
pod 'Alamofire', '4.4'
pod 'SwiftyJSON', '3.1.4'
pod 'Firebase/Core'
pod 'Firebase/RemoteConfig'
end
target 'AppeeUITests' do
inherit! :search_paths
pod 'Firebase/Core'
pod 'Firebase/RemoteConfig'
end
target 'AppeeUITests' do
inherit! :search_paths
end
Here are the warnings that it yields:
Please don't worry for the warnings if you are using FirebaseRemoteConfig (2.0.0) and Protobuf (3.3.0) version. This is already updated and you are using the latest release, so you have to wait for the next release from Google firebase for removing the warning, it means that Firebase team have to work for the updations.
It should be solved by updating your pod.
Steps to update the pod:
1. open terminal and come to your project directory
2. run 'pod update' command
It'll update your all pods framework.
If you received pod command not found then try using 'sudo gem install cocoapods' or follow these steps simply.

Unable to find a specification for `Google Places`

I'm trying to add Google Places SDK to my xcode project but keep getting the error
Unable to find a specification for `GooglePlacePicker`
This is my pod file
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Restaurant' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Restaurant
pod 'GooglePlaces'
pod 'GooglePlacePicker'
pod 'GoogleMaps'
target 'RestaurantTests' do
inherit! :search_paths
# Pods for testing
end
target 'RestaurantUITests' do
inherit! :search_paths
# Pods for testing
end
end
The funny thing is, if I remove 'GooglePlaces' and 'GooglePlacePicker' it installs the 'GoogleMaps' perfectly fine.

How to add a module in Swift app via cocoa pod?

I am trying to add a module (SwiftyJSON) in my app but getting error. I followed https://www.raywenderlich.com/97014/use-cocoapods-with-swift tutorial for installing cocoapod on my Mac OS and it got installed successfully. I also got the module installed successfully. However, when I am trying to load the module in my swift file using the import SwiftyJSON statement I am getting error that says No such module SwiftyJSON.
Documentation for SwiftyJSON: https://github.com/SwiftyJSON/SwiftyJSON#integration
Podfile
platform :ios, '9.0'
target 'ApplePaySwag' do
use_frameworks!
# Pods for ApplePaySwag
pod 'SwiftyJSON'
pod 'AEXML'
target 'ApplePaySwagTests' do
inherit! :search_paths
# Pods for testing
end
end
Am I missing anything?
1) try putting use_frameworks! outside of target (under platform)
2) pod install
3) if import doesn't work try cleaning application (cmd + shift + k)
4) also clean derived data from the project -> xcode -> window -> projects -> derived data (delete)
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'TestingModules' do
use_frameworks!
# Pods for TestingModules
pod 'SwiftyJSON'
pod 'AEXML'
target 'TestingModulesTests' do
inherit! :search_paths
# Pods for testing
end
target 'TestingModulesUITests' do
inherit! :search_paths
# Pods for testing
end
end
Add this in your podfile
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
use_frameworks!
def common_pods
end
target 'ApplePaySwag' do
common_pods
pod 'SwiftyJSON'
pod 'AEXML'
end
target 'ApplePaySwagTests' do
common_pods
end
and Run pod install,
then clean your project..
after that close the ApplePaySwag.xcodeproj and open ApplePaySwag.xcworkspace

Firebase won't work

i don't know if someone have the same problem at the moment, but i'm trying to import Firebase in my app but it only shows "No such module for Firebase". Could anyone please help me?
This is the error i get every time.
EDIT: (Sorry for the noobie errors), this is the code in the Podfile:
target 'CosplaCentral' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for CosplaCentral
target 'CosplaCentralTests' do
inherit! :search_paths
# Pods for testing
end
target 'CosplaCentralUITests' do
inherit! :search_paths
# Pods for testing
pod 'Firebase'
end
end
Update your pod file with the code below, then in Terminal direct to your project file and do pod install (make sure Xcode is closed when doing so) and then load up your project again then retype import Firebase
platform :ios, '8.0'
target 'CosplaCentral' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for LT Sounds
pod 'Firebase'
pod 'Firebase/Auth'
end

Firebase Messaging error while installing pod file

I was trying to install Firebase's pod for messaging and I got this error in terminal....
"Specs satisfying the Firebase/Messaging dependency were found, but they required a higher minimum deployment target."
This is what I have in my 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 'PZPlayer' do
pod ‘Firebase’
pod ‘Firebase/Messaging’
end
"
How can I fix this problem?
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'PZPlayer' do
pod ‘Firebase’
pod ‘Firebase/Messaging’
end
This should be your podfile. Try it.
I did more or less than the guy told us
but my steps were a little different:
1) on the Terminal:
go to your project folder:
1.1) cd Desktop/YourApp
1.2) YOURMAC:YourApp Fernanda$ sudo pod init
2) change your file Podfile to:
` # Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'YourApp' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for YourApp
pod 'Firebase'
end `
3) on the Terminal: pod install
4) Now, change your file Podfile again to:
`# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'YourApp' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for YourApp
pod 'Firebase'
pod 'Firebase/Messaging'
end `
5) on the Terminal: pod update
Sorry my about my English,
Good Look!