stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.13k stars 982 forks source link

[BUG] Failing to build on Xcode 15 beta + Swift 6 #2673

Closed shkhaliq closed 1 year ago

shkhaliq commented 1 year ago

Summary

Running into an error:

/Users/username/repos/my-project/Carthage/Checkouts/stripe-ios/StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:129:30: error: generic parameter 'ResponseType' shadows generic parameter from outer scope with the same name; this is an error in Swift 6
    class func parseResponse<ResponseType: STPAPIResponseDecodable>(

Code to reproduce

Just run the project with Xcode 15 beta and you should run into this

SDK version

23.6.1

Other information

This is happening while building with carthage

yuki-stripe commented 1 year ago

Hi @shkhaliq, we're working on an experimental branch that can compile on Xcode 15 beta - will update this issue when it's ready.

shkhaliq commented 1 year ago

Thank you @lyuxie-stripe

yuki-stripe commented 1 year ago

This branch should compile and work, but may have broken behavior and shouldn't be used in production: https://github.com/stripe/stripe-ios/tree/experimental/xcode-15-beta.

In particular, there's a bug with how Objective C bridging headers are being generated that meant we had to comment out some overriden hash methods and causes our tests to not compile. Expect more updates to come.

Blackjacx commented 1 year ago

When I compile this using the beanch experimental/xcode-15-beta I get the error

Dependency "stripe-ios" has no shared framework schemes for any of the platforms: iOS
shkhaliq commented 1 year ago

When I compile this using the branch experimental/xcode-15-beta I get the error

Dependency "stripe-ios" has no shared framework schemes for any of the platforms: iOS

same here @lyuxie-stripe

yuki-stripe commented 1 year ago

Please try https://github.com/stripe/stripe-ios/tree/experimental/xcode-15-beta-2 with the latest Xcode 15 beta 5.

Blackjacx commented 1 year ago

I think it looks better in terms of bilding the framework 🔥 but now I get the following error:

*** Skipped building stripe-ios due to the error:
Dependency "stripe-ios" has no shared framework schemes for any of the platforms: iOS

I think it is just a forgotten checkmark to share the scheme. Maybe Apple changed how this works 🤔

davidme-stripe commented 1 year ago

Xcode 15 should work in the master branch now. We'll cut a release with the fixes in the next week or two.

The Carthage no shared framework schemes error is because we use Tuist instead of committing our .xcodeproj files in the repo. We commit .xcodeproj files for each tagged version, so this should work in Carthage once we release version 23.13.0 on Monday.

Blackjacx commented 1 year ago

Which Monday exactly?

davidme-stripe commented 1 year ago

Sorry for the ambiguity, we released it today: https://github.com/stripe/stripe-ios/releases/tag/23.13.0

Blackjacx commented 1 year ago

Can confirm it works 👍