How to install SwiftyJSON on osx - swift

I've tried creating a file with the following:
create Podfile
'
platform :osx, '10.0'
use_frameworks!
target 'MyApp' do
pod 'SwiftyJSON', '~> 2.2.0'
end
run command
pod install
this is retuned:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "SwiftyJSON":
In Podfile:
SwiftyJSON (~> 2.2.0)
Specs satisfying the `SwiftyJSON (~> 2.2.0)` dependency were found, but they required a higher minimum deployment target.
I thought maybe it had to do with the platform so I go to the SwiftJSON documentation on CoCaoPods.org.
This is what I found
Oh look maybe instead of 'osx' it's expecting 'macOS'. I update my Podfile to this:
platform :macOS, '10.0'
use_frameworks!
target 'Maconomi' do
pod 'SwiftyJSON', '~> 2.2.0'
end
and run the previous command again and get this error instead:
[!] Invalid `Podfile` file: Unsupported platform `macOS`. Platform must be `:ios`, `:osx`, `:tvos`, or `:watchos`..
# from /Users/travis.rivera/Documents/macOSAPP/Maconomi/Podfile:1
# -------------------------------------------
> platform :macOS, '10.0'
# use_frameworks!
# -------------------------------------------
so now I'm stuck.

platform :osx, '10.10'
use_frameworks!
target 'MyApp' do
pod 'SwiftyJSON', '~> 2.2.0'
end
then
pod install
I missed the osx minimum version number.

Related

No such module OneSignal

I have an issue with OneSignal module. It keeps giving me No such module OneSignal and I installed it by cocoa pods and have use_frameworks! in my pod file. I really have no clue what else I should configure to make it work
I tried other solutions here like:
Getting error No such module using Xcode, but the framework is there
pod file
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'Jaee2' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Jaee2
pod 'OneSignal', '>= 2.5.2', '< 3.0'
end
target 'OneSignalNotificationServiceExtension' do
use_frameworks!
pod 'OneSignal', '>= 2.5.2', '< 3.0'
end
Are you seeing the same error in AppDelegate as well when you import OneSignal there? If no, ensure that in your pod file you added pod 'OneSignal', '>= 2.5.2', '< 3.0' for the target OneSignalNotificationServiceExtension. So your pod file should look like:
target 'OneSignalNotificationServiceExtension' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for OneSignalNotificationServiceExtension
pod 'OneSignal', '>= 2.5.2', '< 3.0'
end
target 'test' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for test
pod 'OneSignal', '>= 2.5.2', '< 3.0'
end
If you dont want use cocoapods. Swift Package Manager available.
Swift Package Manager

SVProgressHUD not working

Its not working did everything like in this video https://www.youtube.com/watch?v=ZpK5KQdn95w
I get the error that the Module SVProgressHUD is not found
here is my Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Bachelmatt Garage' do
# Comment the next line if you're not using Swift and don't want to
use dynamic frameworks
use_frameworks!
pod 'SVProgressHUD';
end
Can someone help me please? There where also things for the UITest and ther other Test in there i simply removed them is that causing the Problem?
Try to install below code:
target 'MyApp' do
pod 'SVProgressHUD', '~> 2.1'
end
In your file
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Bachelmatt Garage' do
# Comment the next line if you're not using Swift and don't want to
use dynamic frameworks
use_frameworks!
pod 'SVProgressHUD', '~> 2.1'
end
Edited
Instead above, Do below code:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘9.0’
use_frameworks!
target ‘YouMe’ do
pod 'SVProgressHUD', '~> 2.1'
end
It will help you.
This podfile is working for me:
use_frameworks!
target 'appName' do
pod 'SVProgressHUD', '~> 2.1.2'
pod 'Alamofire', '~> 4.0'
pod 'FileKit', '~> 4.0.1'
target 'appNameShareExtension' do
inherit! :search_paths # Because else we get the "conflicting names"
end
end
In the Podfile write this:
pod 'SVProgressHUD', :git => 'https://github.com/SVProgressHUD/SVProgressHUD.git'

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!

CocoaPods on Today Extension

I have a project written in Swift with CocoaPods installed. The project have a Today Extension and I added some Pods to this Target. So far so good.
Running on Simulator it's okay! But running on device I got this error:
dyld: Library not loaded: #rpath/Alamofire.framework/Alamofire
Searching on web I found a post from Natasha The Robot talking about the right way to create your Pod file and my Pod seems like this:
# Podfile
platform :ios, '8.0'
use_frameworks!
# My other pods
def my_pods
pod 'Alamofire'
end
target 'MyAppTarget' do
my_pods
end
target 'MyTodayExtensionTarget' do
my_pods
end
I've tried to use link_with but the same error appears
The only solution that I found was deintegrate Cocoapods and add manually the Frameworks.
Does anyone have other solution?
Thanks
Have you tried to repeat your pods in your two targets?
Maybe it's not a very clean solution but I've a project with the same situation as yours an it's working with a Podfile like this one:
# Podfile example
source 'https://github.com/CocoaPods/Specs.git'
inhibit_all_warnings!
target 'mainapp', :exclusive => true do
platform :ios, '8.0'
#Crashlytics
pod 'Fabric'
pod 'Crashlytics'
#Google analytics
pod 'Google/Analytics', '~> 1.0.0'
end
target 'widget', :exclusive => true do
platform :ios, '8.0'
#Crashlytics
pod 'Fabric'
pod 'Crashlytics'
#Google analytics
pod 'Google/Analytics', '~> 1.0.0'
#Logging
pod 'CocoaLumberjack', '~> 2.0'
end