Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Build errors on Xcode 14 beta 1 #1973

Closed
robm92 opened this issue Jun 7, 2022 · 19 comments
Closed

[BUG] Build errors on Xcode 14 beta 1 #1973

robm92 opened this issue Jun 7, 2022 · 19 comments
Labels

Comments

@robm92
Copy link

robm92 commented Jun 7, 2022

Summary

Xcode 14 beta 1 presents a build error in STPApplePayContext.swift l:240

'(any PKPaymentAuthorizationControllerDelegate) -> ((PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) -> Void)?' is not convertible to 'pkDidSelectShippingMethodSignature' (aka 'Optional<((PKPaymentAuthorizationControllerDelegate) -> (PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentRequestShippingMethodUpdate) -> ()) -> ())>')

Code to reproduce

N/A

iOS version

N/A

Installation method

SPM

SDK version

22.4.0

Other information

@robm92 robm92 added the kind:bug label Jun 7, 2022
@gutaker
Copy link

gutaker commented Jun 7, 2022

Quick hotfix, to get rid of the error is to remove casting to pkDidSelectShippingMethodSignature, so the code looks like this:

let pk_didSelectShippingMethod = #selector(
            PKPaymentAuthorizationControllerDelegate.paymentAuthorizationController(
                _:didSelectShippingMethod:handler:))

Dunno how its gonna impact the whole Stripe component functionality, for me thou, it was enough to compile my app and start working on other features.

@davidme-stripe
Copy link
Contributor

Thanks for filing this! There are a few issues with compiling on Xcode 14 — we'll try to have a branch up soon.

@Alex-Coetzee
Copy link

Thanks for filing this! There are a few issues with compiling on Xcode 14 — we'll try to have a branch up soon.

Thanks so much, we are refreshing constantly waiting ahaha! Good luck 👍

@stephengilroy-grx
Copy link

Thanks for being so quick on this!

@jhirshland-dackinc
Copy link

thank you!

@davidme-stripe
Copy link
Contributor

Here's the branch: https://github.com/stripe/stripe-ios/tree/xcode-14-b1

We haven't had a chance to try everything yet — please don't release any builds using this branch to the App Store. We'll merge in these changes before the next minor SDK release.

@davidme-stripe davidme-stripe changed the title [BUG] Xcode 14 beta 1 - build error casting to pkDidSelectShippingMethodSignature [BUG] Build errors on Xcode 14 beta 1 Jun 7, 2022
@davidme-stripe
Copy link
Contributor

These changes landed in 22.5.0, so I'll close this out.

FYI, if you're running into similar issues in your own projects and need to support multiple Xcode versions, you can use the #if compiler(>=5.7) directive to conditionally compile based on the Swift compiler version.

@hajjD
Copy link

hajjD commented Aug 21, 2022

These changes landed in 22.5.0, so I'll close this out.

FYI, if you're running into similar issues in your own projects and need to support multiple Xcode versions, you can use the #if compiler(>=5.7) directive to conditionally compile based on the Swift compiler version.

I am still seeing this issue on 22.7.0 with Xcode 14 Beta 5

@FrankWuoO
Copy link

FrankWuoO commented Aug 29, 2022

Same issue happens with 22.7.0 on Xcode 14 Beta 6

[Update]
After I re-pod install and clean build. It works now.

@zohairhadi
Copy link

Im having this issue with Xcode 14.0.1. Fixed it using the fix mentioned previously @gutaker

@idanCohenDev
Copy link

Downgrading XCode to 13.4.1 solved it for me

@BerkeAras
Copy link

I am using Xcode Version 14.2 (14C18) , Expo SDK 45, but nothing works 😞

@jorger5
Copy link

jorger5 commented Jan 25, 2023

Having trouble too on Xcode v14.2! Maybe this should be re opened?

@davidme-stripe
Copy link
Contributor

For users using Expo, are you on the latest version of the SDK? You may need to run expo install @stripe/stripe-react-native to update. stripe/stripe-react-native#1183 (comment)

@emthomas
Copy link

emthomas commented Feb 7, 2023

I am using Xcode Version 14.2 (14C18) , Expo SDK 45, but nothing works 😞

Same here. With Flutter

@seltsamonkel
Copy link

Using xcode 14.2 (14C18), Expo 45, stripe-react-native 0.6.1, we bumped into this issue and tried to fix it by: #1973 (comment)

while it fixed that specific error but encountered stored properties cannot be marked potentially unavailable with '@available' errors in

  • Stripe/Stripe/CardDetailsEditView.swift:90:6
  • Stripe/Stripe/STPAddCardViewController.switf:132:6

changed those 2 parts of the code by creating a wrapper property, e.g. for CardDetailsEditView.swift

    private var _cardScanningView: Any?
    
    @available(iOS 13, macCatalyst 14, *)
    var cardScanningView: CardScanningView? {
        get { return _cardScanningView as? CardScanningView}
        set { _cardScanningView = newValue }
    }

then in init after super.init

        if #available(iOS 13, macCatalyst 14, *) {
            self.cardScanningView = {
                if !STPCardScanner.cardScanningAvailable() {
                    return nil  // Don't initialize the scanner
                }
                let scanningView = CardScanningView()
                scanningView.alpha = 0
                scanningView.isHidden = true
                return scanningView
            }()
        }

I don't know the full impact of the changes above, but as far as our app is concerned it's working no problem.

@Jitendrawebkul
Copy link

Thanks a lot!

@folusara
Copy link

folusara commented Jul 9, 2023

pkDidSelectShippingMethodSignature

please what file am i use this code. Ive been battling this since this morning. Kindly help!

@orgesballa
Copy link

@folusara
STPApplePayContext is the name of the file.

Method: _delegateToAppleDelegateMapping()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests