CocoaPods on Today Extension - swift

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

Related

Xcode Build Errors After Pod Update

I just did a pod update and tried to build my project; getting the following errors:
And here is my podfile:
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'changelater' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for changelater
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'FirebaseUI/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Functions'
pod 'ProgressHUD'
pod 'Kingfisher', '~> 5.0'
pod 'Stripe', '15.0.1'
pod 'Alamofire'
pod 'GooglePlaces'
pod 'GoogleMaps'
pod 'GooglePlacesSearchController'
pod 'GooglePlacePicker'
end
Any idea why I am getting this error after update? and how I can fix it? I already did shift+command+K but it's not helping.
Cleaning your project is a good practice after updating your pod dependencies.
I had similar issues in the past after updating cocoapods.
Try
In Xcode menu: Product -> Clean build folder (shift+command+K)
Build your project again (command+B)
I simply had to update my xcode to the latest version and the errors disappeared.
It was just because I didnt have the latest xcode. So I had to update my xcode and update my podfile versions. Everything was fine after that!

No such module 'Alamofire' when archive the project swift4

Hello everything is working fine now, but when ever i try to archive the my project i am facing this error "No such module 'Alamofire" i don't know what happend followed many post on stack overflow but still facing same issue
my pods
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'WithinRider' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for WithinRider
pod 'SwiftyJSON', '~> 4.0'
pod 'Alamofire', '~> 4.7'
pod 'MRProgress'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'SwiftGifOrigin'
pod 'SDWebImage', '~> 4.0'
pod 'Toast-Swift', '~> 3.0.1'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'AKMaskField'
pod 'Socket.IO-Client-Swift', '~> 13.2.0'
pod 'BadgeSwift', '~> 5.0'
pod 'SwiftyGif'
pod 'PagingTableView'
pod 'AlamofireObjectMapper', '~> 5.0'
target 'WithinRiderTests' do
inherit! :search_paths
# Pods for testing
end
target 'WithinRiderUITests' do
inherit! :search_paths
# Pods for testing
end
end
error
No such module 'Alamofire'
Have you tried the standard routine?
1. Clean the project
2. Close Xcode, reinstall the missing pod, reopen Xcode
3. Build the project
I got the same error while archiving. Here is a link for proper way of doing that. Sometimes it won't solve your issue. It didn't solve my issue as well. So I had to Edit scheme. Under Achieve I changed Build Configuration as I have several build configurations. And then try to re-archive the project.
I have solved the issue by changing the POD and Project target deployment target as same.

How to install SwiftyJSON on osx

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.

Could not build module 'FBSDKShareKit'

I'm upgrading some pods, namely to support ParseLiveQuery. I'm now running into an error in one of my header files
Could not build module 'FBSDKShareKit'
Also in my errors:
Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.3'
inhibit_all_warnings!
use_modular_headers!
workspace 'myApp'
target 'myApp' do
pod 'ROGoogleTranslate'
pod 'Parse', '1.16.0'
pod 'Parse/FacebookUtils'
pod 'ParseUI', '1.2.0'
pod 'ParseLiveQuery'
pod 'SocketRocket'
pod 'Bolts', '1.9.0'
pod 'Bolts-Swift', :git => 'https://github.com/BoltsFramework/Bolts-Swift', :commit => 'e9baa72d04521c3b25ef4fa6fef12b340953ee02'
pod 'JSQMessagesViewController', '7.3.3'
pod 'FBSDKCoreKit', '~> 4.28.0'
pod 'FBSDKShareKit', '~> 4.28.0'
pod 'FBSDKLoginKit', '~> 4.28.0'
end
I've deleted derived data, cleaned, cleared out my Pods directory and Podfile.lock. Any suggestions on how to fix?
Edit: this is being caused by including use_modular_headers! which stems from my actions after seeing this error
[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod ParseLiveQuery depends upon Parse and Bolts, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.
use_modular_headers!
Works for me

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'