Migrating to CocoaPods 1.1.1 with WatchKit Extension - swift

I am trying to migrate to the latest version of CocoaPods from 0.39. Here is my original podfile:
platform :ios, '10.0'
use_frameworks!
target 'MyApp' do
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
pod 'AlamofireImage', '~> 3.1'
end
target 'MyAppWatchKitApp' do
end
target 'MyAppWatchKitApp Extension' do
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
After reading the CocoaPods 1.0 Migration Guide and this StackOverflow post I tried updating my podfile:
platform :ios, '10.0'
target 'MyApp' do
use_frameworks!
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
pod 'AlamofireImage', '~> 3.1'
target 'MyAppWatchKitApp' do
end
target 'MyAppWatchKitApp Extension' do
end
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
Saving the podfile, running pod update in Terminal, then opening and building the project, I see the following error (client name censored, replace with "MyApp" to match pod files above):
Other things I've tried:
Doing a pod install in addition to pod update
Deleting derived data
I have some good experience with Swift and Xcode but pods are still relatively new to me. Maybe I'm missing something very basic. Any help is greatly appreciated!

Add this line to your post install step in the Podfile.
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'

Related

Flutter iOS build warnings

When I try to archive my flutter product for release I am getting lot of warnings as shown below.
Minimum deployment iOS version: 12
Xcode version: 14.2
My POD file for installation as below:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
You have to change this line in your podfile at root/ios/Podfile to the desired target version.
Then you'd ideally reinstall all pods or do a repo update
Happy coding :)

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.

CocoaPods. The iOS deployment target IPHONE_DEPLOYMENT_TARGET

I have a host of CocoaPods that all throwing this warning:
The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99.
anyway to correct these?
Would converting to Swift Packages help, and if so is there a way to tell if a Pod has a swift package?
Thanks all,
In the pod file at the end, you can use this to set the minimum os version for each of your pods to a specific version and then run pod install command from terminal. This will change deployment target version.
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end

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'

Can't migrate to 3.0 pods libraries

I use Kanna and Reachability libraries. And seems they already migrated to swift 3. I use Cocoapods:
# 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 'MyProj' do
pod 'Kanna', '~> 2.0.0'
pod 'ReachabilitySwift', '~> 3'
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
Got error when do import:
import Kanna
import ReachabilitySwift
Module compiled with Swift 2.3 cannot be imported in Swift 3.0
Flag: Use legacy swift versions everywhere set to No
Found solution here. Need to delete rm -rf ~/Library/Developer/Xcode/DerivedData/ This folder was cached.