hawkbee
hawkbee

Reputation: 1621

Dependency issue when migrating ios package from swift package manager to cocoapods: try increasing the minimum deployment target

I have to build a flutter sdk over an ios package. Flutter is currently not handling packages from swift project manager (https://github.com/flutter/flutter/issues/126005 ) so I need to migrate it to cocoapods. I used those sources to handle migration: https://dev.to/ankushppie/creating-custom-pods-in-swift-for-ios-a-step-by-step-guide-1p6g https://quickbirdstudios.com/blog/swift-package-manager-cocoapods-support/ https://forums.swift.org/t/whats-the-best-practice-to-convert-wrap-swift-package-to-a-cocoapods-package/55423

Here is the repository of the SDK: https://github.com/hashgraph/hedera-sdk-swift The steps I followed: create Hedera.podspec create git repository, push code and add version tag When I launch the command “pod lib lint Hedera.podspec --verbose”

I have the following error at the end:

17.0.99. (in target 'CNIOBoringSSL' from project 'Pods') /var/folders/ff/mx003tp93sz49fwvzc_9lth80000gn/T/CocoaPods-Lint-20231202-13098-ug7lsb-Hedera/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIOAtomics' from project 'Pods') /var/folders/ff/mx003tp93sz49fwvzc_9lth80000gn/T/CocoaPods-Lint-20231202-13098-ug7lsb-Hedera/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CGRPCZlib' from project 'Pods') ** BUILD FAILED **

The following build commands failed:
  Ld /Users/xxxxxxx/Library/Developer/Xcode/DerivedData/App-fskyyawbnysknlgqzhphycdzoaaf/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging

normal x86_64 (in target 'Logging' from project 'Pods') (1 failure) Testing with xcodebuild. -> Hedera (1.0.0) - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. - NOTE | xcodebuild: note: Using codesigning identity override: - - NOTE | [iOS] xcodebuild: note: Building targets in dependency order - NOTE | [iOS] xcodebuild: note: Target dependency graph (28 targets) - NOTE | xcodebuild: ld: warning: ignoring duplicate libraries: '-lc++' - NOTE | [iOS] xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target '_NIODataStructures' from project 'Pods') - NOTE | [iOS] xcodebuild: clang: error: SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOTLS' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOPosix' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOSSL' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOHTTP2' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'gRPC-Swift' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target '_NIODataStructures' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftProtobuf' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOTransportServices' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOHTTP1' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOHPACK' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOFoundationCompat' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOExtras' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOEmbedded' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOCore' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIOConcurrencyHelpers' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'SwiftNIO' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'Logging' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIOWindows' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIOLinux' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIOHTTPParser' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIODarwin' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIOBoringSSLShims' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIOBoringSSL' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CNIOAtomics' from project 'Pods') - NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'CGRPCZlib' from project 'Pods') [!] Hedera did not pass validation, due to 1 error. You can use the --no-clean option to inspect any issue. /opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.14.3/lib/cocoapods/command/lib/lint.rb:116:in block in run' /opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.14.3/lib/cocoapods/command/lib/lint.rb:77:in each' /opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.14.3/lib/cocoapods/command/lib/lint.rb:77:in run' /opt/homebrew/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' /opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.14.3/lib/cocoapods/command.rb:52:in run' /opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.14.3/bin/pod:55:in <top (required)>' /opt/homebrew/Cellar/cocoapods/1.11.2/libexec/bin/pod:23:in load' /opt/homebrew/Cellar/cocoapods/1.11.2/libexec/bin/pod:23:in '

I tried creating a new pod library with “pod lib create Hedera”, doing such I get Podfile, xcworkspace and xcodeproj but it doesn't change the result. Same thing when I had the following script in Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
# workspace 'Hedera.xcworkspace'
post_install do |installer|
 installer.pods_project.targets.each do |target|
   target.build_configurations.each do |config|
       config.build_settings['IPHONE_DEPLOYMENT_TARGET'] = '13.0'
   end
end
end

I'm style facing the same issue.

Here is the content of Hedera.podspec:

#
# Be sure to run `pod lib lint hedera-sdk-swift.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#


Pod::Spec.new do |s|
 s.name             = 'Hedera'
 s.version          = '1.0.0'
 s.summary          = 'Non official cocoapod  SDK for interacting with Hedera Hashgraph.'


# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!


 s.description      = <<-DESC
The SDK for interacting with Hedera Hashgraph: the official distributed consensus platform built using the hashgraph consensus algorithm for fast, fair and secure transactions. Hedera enables and empowers developers to build an entirely new class of decentralized applications.
                      DESC


 s.homepage         = 'https://github.com/TalaoDAO/hedera-sdk-swift'
 # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
 s.license          = { :type => 'APACHE', :file => 'LICENSE' }
 s.author           = { 'hawkbee1' => '[email protected]' }
 s.source           = { :git => 'https://github.com/TalaoDAO/hedera-sdk-swift.git', :tag => s.version.to_s }
 # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'


 s.ios.deployment_target = '13.0'
 s.swift_version = '5.9'
 s.platform = :ios, '13.0'


 s.source_files = 'Sources/Hedera/**/*'
  # s.resource_bundles = {
 #   'hedera-sdk-swift' => ['hedera-sdk-swift/Assets/*.png']
 # }


 # s.public_header_files = 'Pod/Classes/**/*.h'
 # s.frameworks = 'UIKit', 'MapKit'
 s.dependency 'gRPC-Swift', '~> 1.8.0'
#  s.dependency 'gRPC-Swift', '~> 1.8.0'
 # Hedera.xcworkspace
end

I suppose I need a way to force deployment target for each pod but I don't understand how to do it.

Upvotes: 0

Views: 507

Answers (1)

Paul Beusterien
Paul Beusterien

Reputation: 29582

The problem is that the gRPC-Swift dependency - Logging has a minimum iOS dependency of 8.0 which leads to https://github.com/CocoaPods/CocoaPods/issues/12033.

The other more general issue is that the gRPC-Swift project https://forums.swift.org/t/grpc-swift-is-dropping-support-for-cocoapods/56841 for CocoaPods, so this will be a challenging implementation to maintain for the future.

Despite all of this, if you wanted to go forward, I see two options:

  • Create alternate podspecs for gRPC-Swift and all of its dependencies with a higher minimum iOS version. Going to at least 12 would also get rid of all of the minimum target warnings.
  • Implement a solution and send and merge a PR for https://github.com/CocoaPods/CocoaPods/issues/12033 and then wait for the next CocoaPods release.

Upvotes: 1

Related Questions