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

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

Related

How to properly uninstall AdMob from iOS app

I have uninstalled the AdMob SDK by commenting out the lines in the Podfile. Then I run pod update. The AdMob SDK and the utilities are removed. However, I get framework not found FBLPromises error.
I have use_frameworks! uncommitted in the Podfile.
Even if I comment out use_frameworks! And run pod update I still get the error.
Here's my Podfile.
# Uncomment the next line to define a global platform for your project
platform :ios, '15.0'
target 'My Collection' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Auburn Collection
pod 'Gemini', '~> 1.4'
# pod 'Google-Mobile-Ads-SDK', '~> 8.9'
# pod 'GoogleUtilities', '~> 7.5'
pod 'TTSegmentedControl', '~> 0.4.9'
end
Two questions:
Do I need to use frameworks for the two remaining pods?
What am I doing wrong and what can I do to fix the error?
Thanks for the help in advance.
I did a search in my app for FBLPromises. It was still in Build Settings > Linking > Other Linked Flags. I had to manually delete it along with other AdMob frameworks. This solved the problem.
It also appears that Gemini uses frameworks so I do need them.

No such module 'XLPagerTabStrip'

i use tutorial https://medium.com/michaeladeyeri/how-to-implement-android-like-tab-layouts-in-ios-using-swift-3-578516c3aa9 and get error No such module 'XLPagerTabStrip'
My Podfile
`# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'NewsTabs' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'XLPagerTabStrip', '~> 8.0'
end
`
I had the same issue when I set my App's Deployment Target set 10.0.
I have fixed this issue by updating Pods.
Step 1: Navigate to your project.
cd /Users/Prakasha/Desktop/Workspace/Projects/YourApp
Step 2: pod update.
this will update your system's all pod files.
thats it once updating completes, quit Xcode and reopened, bugs go away.

Linker Issue Xcode Cocoapods

Installed three pods but for some reason can't get it to work
I tried reinstalling, updating, deintegrating but nothing does it.
I get the following errors. Tried creating the folders manually but the Linker Error remains always
Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Clima' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Clima
pod 'SwiftyJSON'
pod 'Alamofire'
pod 'SVProgressHUD'
end
The frameworks aren't being built. Just open {Yourproject}.xcworkspace generated after adding cocoapods instead of {Yourproject}.xcodeproj - that should help.

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

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

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!