ezet / stripe-sdk

A simple and flexible Stripe library for Flutter with complete support for SCA and PSD2.
https://pub.dev/packages/stripe_sdk
Other
137 stars 137 forks source link

Cannot build with XCode 12.5 #137

Closed lucaspal closed 3 years ago

lucaspal commented 3 years ago

The package is not compatible with the latest Apple CLang compiler, used by XCode 12.5, resulting in builds failing with the following error:

    /<my_project>/ios/Pods/Stripe/Stripe/STPPinManagementService.m:51:81: error: 'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin
                                                    deserializer:[STPIssuingCardPin new]
                                                                                    ^

In file included from /<my_project>/ios/Pods/Stripe/Stripe/STPPinManagementService.m:11:
    /<my_project>/ios/Pods/Stripe/Stripe/PublicHeaders/STPIssuingCardPin.h:22:1: note: 'init' has been explicitly marked unavailable here
    - (instancetype)init __attribute__((unavailable("You cannot directly instantiate an STPIssuingCardPin")));
    ^

    /<my_project>/ios/Pods/Stripe/Stripe/STPPinManagementService.m:101:81: error: 'new' is unavailable: You cannot directly instantiate an STPIssuingCardPin
                                                    deserializer:[STPIssuingCardPin new]
                                                                                    ^
In file included from /<my_project>/ios/Pods/Stripe/Stripe/STPPinManagementService.m:11:
    /<my_project>/ios/Pods/Stripe/Stripe/PublicHeaders/STPIssuingCardPin.h:22:1: note: 'init' has been explicitly marked unavailable here
    - (instancetype)init __attribute__((unavailable("You cannot directly instantiate an STPIssuingCardPin")));

From a first look at the changelog from Apple (available here), the reason of the failure seems to be the following:

Clang now infers the availability of +new from availability annotations on -init methods. Since +new calls [[Foo alloc] init], +new isn’t available unless +init is available. (75884815)


Details:

Alecsplus commented 3 years ago

Any news on this issue? This unfortunately makes us impossible to adopt this plugin. Thanks for all.

ezet commented 3 years ago

No, I am unable to debug the issue as I don't use Apple devices. Any suggestions or PRs would be appreciated.

On Thu, May 6, 2021 at 10:59 AM Alecsplus @.***> wrote:

Any news on this issue? This unfortunately makes us impossible to adopt this plugin. Thanks for all.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ezet/stripe-sdk/issues/137#issuecomment-833358894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADQOQ7BZVU35A5YVGI56D3TMJK65ANCNFSM44AKHN7Q .

lucaspal commented 3 years ago

@ezet Could you add some labels to make that more explicit?

E.g. iOS, help wanted, bug

lucaspal commented 3 years ago

@ezet I am closing this issue since the error that I had was not related with this library.

There is, in fact, no way this package can be broken on newer versions of XCode, being this a native Dart package and, thus, not containing any native Swift code.

In my case, there was another package that was using an outdated version of the native Stripe SDK (iOS) and that was the one breaking the build.

Sorry for the inconvenience, I hope this can also help the others.