stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

iOS build fails: Stored properties cannot be marked potentially unavailable with '@available'

Open JuxhinB opened this issue 4 years ago • 16 comments

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
 }()

JuxhinB avatar Nov 26 '22 13:11 JuxhinB

I have the same issue

Stripe version is 0.2.2. react-native version is 0.66.5

MohamedAhmed122 avatar Nov 28 '22 05:11 MohamedAhmed122

Same issue, if someone have an idea ...

Hadi-G avatar Nov 28 '22 16:11 Hadi-G

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
 }()

I updated my stripe-react-native to the latest version. After that you will have to update the FlipperKit versions. The build is now working.

for the flipper version in your pod file :

versions['Flipper'] ||= '~> 0.88.0' versions['Flipper-Folly'] ||= '~> 2.6.7' versions['Flipper-RSocket'] ||= '~> 1.4.3'

Hadi-G avatar Nov 29 '22 11:11 Hadi-G

@Hadi-G I don't actually have flipper at all. I am working in an old project with expo "expo": "^40.0.1", "react-native": "^0.61.5"

JuxhinB avatar Nov 29 '22 19:11 JuxhinB

@JuxhinB Flipper is issue is a consequence of the update of stripe-react-native, so may be you are not concerned.

Have you tried to update the stripe-react-native package to a recent version ?

Hadi-G avatar Dec 01 '22 06:12 Hadi-G

@Hadi-G there many libraries, which make use of that version of react-native, updating it would break many things and require me to upgrade also other libraries. This is a situation I'm stuck with older but stable version of libraries related to each other.

JuxhinB avatar Dec 01 '22 21:12 JuxhinB

npx react-native info results

System: OS: macOS 12.5.1 CPU: (10) x64 Apple M1 Pro Memory: 284.89 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v14.20.0/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v14.20.0/bin/npm Watchman: 2022.11.28.00 - /opt/homebrew/bin/watchman SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8815526 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild npmPackages: react: ^16.9.0 => 16.9.0 react-native: ^0.61.5 => 0.61.5

JuxhinB avatar Dec 01 '22 21:12 JuxhinB

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

JuxhinB avatar Dec 01 '22 21:12 JuxhinB

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: facebook/react-native#31094 (comment)

Hey @JuxhinB I am also having old project and I am having XCode 14.1. Is there any way of solving this error?

ravis-farooq avatar Dec 15 '22 06:12 ravis-farooq

I have this issue too. recently update to Xcode 14.2

jffs avatar Jan 12 '23 19:01 jffs

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....??

abdulRafay2003 avatar Jan 16 '23 11:01 abdulRafay2003

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/[email protected] then pod deintegrate pod update and pod install

jffs avatar Jan 16 '23 11:01 jffs

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/[email protected] then pod deintegrate pod update and pod install

Thanks it worked.....👍

abdulRafay2003 avatar Jan 16 '23 14:01 abdulRafay2003

What if wee want to keep the older version ? there's a lot of changes in the newest version...

hugoh59 avatar Jan 17 '23 12:01 hugoh59

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/[email protected] then pod deintegrate pod update and pod install

Thanks! it's working for me

syedrahaman92 avatar Feb 14 '23 13:02 syedrahaman92

What if wee want to keep the older version ? there's a lot of changes in the newest version...

Hey @hugoh59, do you find any solution on this one?

jgalarce-perficient avatar Mar 30 '23 15:03 jgalarce-perficient