stripe-react-native: iOS build fails: Stored properties cannot be marked potentially unavailable with '@available'

After updating xCode to v14.1 I’m unable to build project anymore.

Stripe version is 0.2.2.

Error is at CardDetailsEditView.swift,

Stored properties cannot be marked potentially unavailable with '@available'

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 16

Most upvoted comments

I am also facing the same issue my project. is only working if run the project on older xcode version it is not running on xcode 14 and above… any solution…??

I have to install the last version of “stripe-react-native”. npm i @stripe/stripe-react-native@0.23.0 then pod deintegrate pod update and pod install

I have the same issue

Stripe version is 0.2.2. react-native version is 0.66.5

I am also facing the same issue my project. is only working if run the project on older xcode version it is not running on xcode 14 and above… any solution…??

I have to install the last version of “stripe-react-native”. npm i @stripe/stripe-react-native@0.23.0 then pod deintegrate pod update and pod install

Thanks! it’s working for me

I managed to solve my issue, I needed to downgrade my xcode version to 13.7. I updated because I was trying to fix this issue indeed : RN 0.63.4 main.jsbundle does not exist. This must be a bug with’

And the answer of my issue was in this comment: https://github.com/facebook/react-native/issues/31094#issuecomment-796743154