Getting errors in framework files after trying to install new pod - swift

I've been having a recurring issue that has to do with my pod file and my target swift language version. In the past I have gotten it solved by changing my language version to 4.0 (I think).
What happens is that I update my pod file and then I start getting errors in the framework files that I cannot change because it says they are locked.
I do not understand my pod file and language settings that well which is making it hard to troubleshoot.
I'd like to migrate my frameworks to a newer language version like it recommends, but it says I cannot do that until I make them compile with the previous version.
I'm not sure how to troubleshoot or what steps to take to get this all cleared up. Can anyone help?
Here is my podfile
target 'DarkhorseDFS' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#pod 'RAMAnimatedTabBarController', '~> 4.0'
#pod 'XLPagerTabStrip', :git => 'https://github.com/KelvinJin/XLPagerTabStrip', :branch => 'swift3'
#pod 'BTNavigationDropdownMenu', :git => 'https://github.com/PhamBaTho/BTNavigationDropdownMenu.git', :branch => 'swift-3.0'
pod 'BTNavigationDropdownMenu'
pod 'XLPagerTabStrip'
pod 'SCLAlertView'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'SwiftyJSON', '~> 4.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'Kingfisher'
pod 'Tutti'
pod 'Segmentio'
#pod 'PVSwitch'
pod 'MBProgressHUD'
pod 'Alamofire'
end
target 'DarkhorseDFSTests' do
inherit! :search_paths
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
I've also tried changing the settings in under 'Target'.
Heres an example of some errors I'm getting, but also many 'name has been changed' errors.
All these frameworks worked before trying to install a new pod. But now I can't get the errors to go away, even when I uninstall!
Can anyone please help?

I needed to change my swift language version for each pod individually, not just in project build settings.
Click on Pods in the navigator, then the language version can be set in build settings.

Related

No such module 'FirebaseFirestore' watchOS

After I added watchOS target, "No such module 'FirebaseFirestore'" appeared in the file which is a member of both targets (main target and watches target). The rest of the pods seem to work correctly. (despite the FirebaseFirestoreSwift, which is not installing when pod install)
I am using Xcode 14.0.1 on an M1 mac.
What is wrong with this pod and how can I fix it?
My Podfile
#platform :ios, '16.0'
use_frameworks!
def firebase_pods
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/RemoteConfig'
#pod 'FirebaseFirestoreSwift'
end
def helpers_pods
pod 'R.swift'
pod 'Resolver'
end
target 'HonestMate' do
platform :ios, '16.0'
use_frameworks!
helpers_pods
firebase_pods
target 'HonestMateTests' do
inherit! :search_paths
# Pods for testing
end
target 'HonestMateUITests' do
# Pods for testing
end
end
target 'HonestMate Watch App' do
platform :watchos, '9.0'
use_frameworks!
firebase_pods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
end
end
end
```
`
I tried Command+Option+K, cleaned Derived Data, checked is xcworkspace opened. Tried deleting and reinstalling the pods, updated cocoa pods to cocoapods-1.11.3.
Using SPM is not suitable, because I have R.Swift pod.
I also tried installing pods from GitHub repo (https://github.com/firebase/firebase-ios-sdk/blob/master/README.md#installing-from-github):
pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'
pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'
but have an error The platform of the target HonestMate Watch App (watchOS 9.0) is not compatible with FirebaseFirestore (10.3.0), which does not support watchOS.
Firestore is not available for watchOS. See this table for the Firebase Apple platform matrix support details.

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.

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

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.