Cocoapod - [!] Unable to find a specification for 'Analytics' - swift

I am trying to install pod for Analytics. It installs the pod successfully if I have Analytics pod only in the Podfile. The Podfile is below:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'TestSDK' do
# Comment the next line if you're not using Swift and don't want to
use dynamic frameworks
use_frameworks!
pod 'Analytics'
end
But if I add private source for another pod in the same Podfile, it gives the above error. The new Podfile is below:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'XXXXXX Private Repo XXXXXX'
target 'TestSDK' do
# Comment the next line if you're not using Swift and don't want to
use dynamic frameworks
use_frameworks!
pod 'Analytics'
pod 'pod_from_the_private_repo' , '=1.0.0'
end
The above Podfile successfully install the pod_from_the_private_repo but it shows error for the Analytics only which was installing successfully in the previous case.

Configuration should look something like this:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
# Private pods Spec repository
source 'https://path to your private repo'
# Public spec repository
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'ProjectName' do
# Pods for ProjectName
pod 'Crashlytics'
# Private pods
end

Related

Pod Init with default option set to OSX & not IOS for CocoaPods in Swift using Xcode?

I closed my Xcode project & went into the project directory & typed
pod init
And it made a Podfile like
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Test1' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Test1
end
Notice the 2nd line - platform :ios, '9.0' but mine is a Mac Desktop app
So I had to manually change it to use platform :osx, '10.12'
# Uncomment the next line to define a global platform for your project
# platform :osx, '10.12'
target 'Test1' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Test1
end
Is there an option to directly create one for Mac Desktop App like pod init --mac or something like that?
There is no option --mac or anything equivalent at this moment.
You can check all the available options for pod init here: https://guides.cocoapods.org/terminal/commands.html#pod_init

cocoa pods not working

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

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