flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
956 stars 525 forks source link

build issue for ios with flutter_stripe 9.2.2 - "is only available in iOS 13.0 or newer" #1316

Closed FetFrumos closed 1 year ago

FetFrumos commented 1 year ago

Describe the bug I use flutter_stripe: ^9.2.2 in my app. It is working for android, but I have build issue for iOS. This is part from my podfile

  `platform :ios, '13.0'

I used "minimum deployment" - 13.0 in XCode. Before 'pod install' I used this commands:

  rm -rf Pods
  rm -rf Podfile.lock
  rm -rf ~/.pub-cache/hosted/pub.dartlang.org/
  pod cache clean --all
  flutter clean
  flutter pub get
  pod repo update
  pod install

'pod install' - working. This is some detail from log:

  Installing Stripe (23.7.1)
  Installing StripeApplePay (23.7.1)
  Installing StripeCore (23.7.1)
  Installing StripeFinancialConnections (23.7.1)
  Installing StripePaymentSheet (23.7.1)
  Installing StripePayments (23.7.1)
  Installing StripePaymentsUI (23.7.1)
  Installing StripeUICore (23.7.1)

but when i run the ios build - i get many errors like this - is only available in iOS 13.0 or newer:

Could not build the precompiled application for the device. Swift Compiler Error (Xcode): 'systemGray4' is only available in iOS 13.0 or newer /Users/rockstar/Documents/StudioProjects/tapkeenapp/ios/Pods/StripeUICore/StripeUICore/StripeUICore/Source/Controls/Button.swift:505:38

Swift Compiler Error (Xcode): 'secondarySystemFill' is only available in iOS 13.0 or newer /Users/rockstar/Documents/StudioProjects/tapkeenapp/ios/Pods/StripeUICore/StripeUICore/StripeUICore/Source/Controls/Button.swift:516:30

Swift Compiler Error (Xcode): 'label' is only available in iOS 13.0 or newer /Users/rockstar/Documents/StudioProjects/tapkeenapp/ios/Pods/StripeUICore/StripeUICore/StripeUICore/Source/Elements/ElementsUI.swift:100:38 ..............

how do i fix this error?

I used:

prossion commented 8 months ago

Hey, i have the same problem. How do you fix it? Change the phone, or update xCode/Flutter?

sarbogast commented 8 months ago

I have the same problem with Flutter 3.19.3 and flutter_stripe 10.1.1 right now. And both my Podfile and my project.pbxproj target iOS 13.0:

Could not build the precompiled application for the device.
Swift Compiler Error (Xcode): 'init(memoryCapacity:diskCapacity:directory:)' is only available in iOS 13.0 or newer
/Users/sarbogast/dev/myapp/ios/Pods/StripeCore/StripeCore/StripeCore/Source/DownloadManager/DownloadManager.swift:43:24

Swift Compiler Error (Xcode): 'value(forHTTPHeaderField:)' is only available in iOS 13.0 or newer
/Users/sarbogast/dev/myapp/ios/Pods/StripeCore/StripeCore/StripeCore/Source/Helpers/STPError.swift:213:41

Swift Compiler Error (Xcode): 'schedule(after:_:)' is only available in iOS 13.0 or newer
/Users/sarbogast/dev/myapp/ios/Pods/StripeCore/StripeCore/StripeCore/Source/Helpers/URLSession+Retry.swift:28:35
sarbogast commented 8 months ago

I figured it out. In my Podfile, I had a script to update the deployment target on dependencies that still updated them to 12.0 instead of 13.0. If you have this problem, check your Podfile for a line like this one:

config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'