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
Related
I am trying to implement the in-app Chat SDK from Mirrorfly to my project, however when i try to initialize their UIKit i get the following error:
Failed to build module 'FlyUIKit' for importation due to the errors
above; the textual interface may be broken by project issues or a
compiler bug.
I tried deleting my cache as well as re-installing all my Cocoapod dependencies, which didn't help. Afterwards i updated my xcode since it might have been an xcode problem but afterwards i got this error:
Failed to build module 'FlyUIKit'; this SDK is not supported by the
compiler (the SDK is built with 'Apple Swift version 5.7.1
(swiftlang-5.7.1.135.3 clang-1400.0.29.51)', while this compiler is
'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5
clang-1400.0.29.51)'). Please select a toolchain which matches the
SDK.
My Settings are:
MacBook Pro (M1)
MacOs Ventura
Xcode 14.2
enable Bitcode is disabled
BUILD_LIBRARY_FOR_DISTRIBUTION is true
other than that SDK there was nothing else imported.
My Podfile:
target 'iosApp' do
use_frameworks!
platform :ios, '14.1'
pod 'shared', :path => '../shared'
pod 'Alamofire'
pod 'XMPPFramework/Swift'
pod 'Toaster'
pod 'Firebase/Auth'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'SDWebImage'
pod 'libPhoneNumber-iOS'
pod 'NicoProgress'
pod 'SocketRocket'
pod 'Socket.IO-Client-Swift', '~> 15.2.0'
pod 'GoogleWebRTC' # WebRTC for Calls
pod 'RealmSwift', '10.20.1'
pod 'IQKeyboardManager'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.1'
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
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 :)
After updating to Xcode 14 I'm getting the following error:
Signing for "GoogleSignIn-GoogleSignIn" requires a development team. Select a development team in the Signing & Capabilities editor.`
I've tried doing pod update but it doesn't work.
I had the same issue after switching to Xcode 14. Add this to your podfile and call pod install. This will permanently fix the issue.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
end
end
From the target POD Select
GoogleSignIn-GoogleSignIn
then go to the team drop list and select your team
Add this to your podfile and call pod install
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['WRAPPER_EXTENSION'] == 'bundle'
config.build_settings['DEVELOPMENT_TEAM'] = 'YOUR_DEVELOPMENT_TEAM_ID'
end
end
end
end
I recommend you update to the latest React Native version (at time of writing: v0.70.3) to get their fix (https://github.com/facebook/react-native/issues/34673) for the code signing change to XCode14
You can check your latest react native package version with yarn list --pattern react-native in your project root
After updating either:
update ios/Podfile with the following
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['WRAPPER_EXTENSION'] == 'bundle'
config.build_settings['DEVELOPMENT_TEAM'] = 'YOUR_DEVELOPMENT_TEAM_ID'
end
end
end
end
where YOUR_DEVELOPMENT_TEAM_ID is replaced with the actual value
or
Manually go through the pods failing the build and select your development team and re-attempt building.
For me, for my flutter project after upgrading my Xcode:
Open ios->Podfile
Remove the function from "post_install"
Add the below code.
Note: Do not forget to change your Development Team Code.
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
if config.build_settings['WRAPPER_EXTENSION'] == 'bundle'
config.build_settings['DEVELOPMENT_TEAM'] = 'YOUR_DEVELOPMENT_CODE'
end
end
end
end
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'
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.