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

Build failure on macOS 11.3 and Xcode 12.5 #284

Open
medvegy opened this issue Apr 27, 2021 · 28 comments
Open

Build failure on macOS 11.3 and Xcode 12.5 #284

medvegy opened this issue Apr 27, 2021 · 28 comments

Comments

@medvegy
Copy link

medvegy commented Apr 27, 2021

Xcode's output:

.../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 .../ios/Pods/Stripe/Stripe/STPPinManagementService.m:11:
.../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")));
^
.../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 .../ios/Pods/Stripe/Stripe/STPPinManagementService.m:11:
.../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")));
^
2 errors generated.

Using latest stripe_payment: ^1.0.11

[✓] Flutter (Channel stable, 2.0.5, on macOS 11.3 20E232 darwin-x64, locale en-SK)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
[✓] Connected device (3 available)

@SN1kolaev
Copy link

Confirm, having the same issue.

@parabellumGIT
Copy link

same issue after updating to Xcode 12.5

@medvegy medvegy changed the title Build failure on macOS 11.3 Build failure on macOS 11.3 and Xcode 12.5 Apr 27, 2021
@ArnauJorda
Copy link

ArnauJorda commented Apr 27, 2021

Same here, must be related with Apple Clang Update: https://developer.apple.com/documentation/xcode-release-notes/xcode-12_5-release-notes, it says: 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)

@dragosholban
Copy link

Same :(
It seems it's the Stripe 19.4.0 dependency. Any ideas on how to force update to 19.4.1?

@ArnauJorda
Copy link

Downgrading to XCODE 12.4 solved the issue

@mathatan
Copy link

mathatan commented Apr 27, 2021

You can build by forcing the Stripe dependency to be fetched from Stripe GitHub by adding following to the end of your Podspec file in the ios directory inside your flutter project:

pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git', :tag => 'v19.4.1'

It's not ideal but looks like that v19.4.1 is not even yet available from Cocoapods directly.

Also I'm not sure if it's required for your project, but I had to enable Non-modular includes within my flutter project build settings. (as mentioned in https://stackoverflow.com/questions/27776497/include-of-non-modular-header-inside-framework-module)

@chaesung
Copy link

pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git', :tag => 'v19.4.1'

Doesn't seem to work... @mathatan can you please provide more detailed steps?

Thanks in advance

@angelocapone
Copy link

Same problem to me.
I've added the above line at the end of ios/Podfile file but same issue.
@mathatan can you provide more details, please?

@mathatan
Copy link

Have you tried to run pod update within iOS directory? I also noticed that it does not run within simulator for what ever reason.

@angelocapone
Copy link

tried pod update... but getting same issue on both simulator and physical iPhone.

@mathatan
Copy link

Depending a bit on which errors you get it might benefit to run flutter clean before build. I personally would still recommend downgrading Xcode to 12.4 but I'll try to add more detailed instructions:

  • Run flutter clean
  • Add the pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git', :tag => 'v19.4.1' to the end of your Podspec
  • Run flutter build ios --debug (or what ever you prefer)
  • (depending a bit if your Xcode complains about Non-modular includes; which it should - enable them with the guide explained in https://stackoverflow.com/questions/27776497/include-of-non-modular-header-inside-framework-module)
  • If the build fails (which it might) cd ios and pod update (you might need to do pod repo-update as well)
  • Return to your main project directory and rerun flutter build ios --debug

I'm not using the main branch for this package and I have some additional things in my Podspec, so I'm not fully certain if that could have effects on me being able to make the build. You can try to paste the error from your build, although I cannot promise I'll be able to help. Still though since the non modular import of 3DS breaks simulators I'm downgrading to Xcode 12.4 anyhow. Hopefully this will be resolved soon enough with an actual cocoapods repository version of the 19.4.1 SDK.

@angelocapone
Copy link

@mathatan I'm going to downgrade XCODE to 12.04

@wilpar
Copy link

wilpar commented Apr 28, 2021

I was able to get the app running with only the pod specified. No need (for now) to downgrade Xcode

pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git', :tag => 'v19.4.1'

@jonasbark
Copy link
Owner

My recommendation:

  • don't upgrade Xcode during the first days after release if you work with flutter
  • open up a ticket on the stripe-ios repo and ask them to release the 19.4.1 version :)

@Aristotelis1
Copy link

Same problem to me. Should i wait or downgrade to 12.4?

@jonasbark
Copy link
Owner

as there won't be an official release of 19.4.1 it's unlikely this will be fixed soon, so I recommend downgrading to 12.4

PSA: we're working on a brand new plugin that uses the latest dependencies. flutter_stripe_payment will only receive maintenance updates going forward.

@stereotypeCoder
Copy link

as there won't be an official release of 19.4.1 it's unlikely this will be fixed soon, so I recommend downgrading to 12.4

PSA: we're working on a brand new plugin that uses the latest dependencies. flutter_stripe_payment will only receive maintenance updates going forward.

@jonasbark what will be the name of the plugin?

@ag84ark
Copy link

ag84ark commented May 1, 2021

I was finally able to make it work with plugin version 1.0.11 and Xcode 12.5

Podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
    end
  end
end

pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git', :tag => 'v19.4.1'

In the plugin v1.0.11 -> ios/TPSStripeManager.h change:

- #import <Stripe/Stripe.h>
+ @import Stripe;

Hope that this helps someone, it took me 2 days to get here :) ( No experience in Swift or Object C )

@jonasbark
Copy link
Owner

Thanks for providing that information @ag84ark !

For anyone else: we published the first beta version of the new plugin here:
https://github.com/flutter-stripe/flutter_stripe
We'd love to get some feedback. Expect 50% more features, 80% fewer existing bugs, and 10(?)% new bugs which we're eager to fix. If you find it useful, feel free to support us on opencollective :)

When I find the time I'll provide some migration instructions for this plugin.

@angelocapone
Copy link

@jonasbark This is a good new!
I will test the new plugin straight away!

@iamtheappguy
Copy link

do you have a timeline for google pay in the migration?

@ghost
Copy link

ghost commented May 26, 2021

Do we use flutter_stripe_payment or flutter_stripe or stripe_payment? I'm confusion

@iamtheappguy
Copy link

iamtheappguy commented May 26, 2021

Do we use flutter_stripe_payment or flutter_stripe or stripe_payment? I'm confusion

hey used stripe_payment_flutter in the interim and got it all working last week

@ghost
Copy link

ghost commented May 27, 2021

stripe_payment_flutter has the same problems as this package for me. Migrating to flutter_stripe is very painful since the API is completely different and stuff is split between multiple packages and some things no longer exist... I tried the latest version:

publish_to: none

...
flutter_stripe: 
  git: 
    url: https://github.com/flutter-stripe/flutter_stripe.git
    path: packages/stripe
    ref: 659b5288f3d3da5ce1e2fd3ade1bc9fc24d4cf64 # latest master

@iamtheappguy
Copy link

stripe_payment_flutter has the same problems as this package for me. Migrating to flutter_stripe is very painful since the API is completely different and stuff is split between multiple packages and some things no longer exist... I tried the latest version:

publish_to: none

...
flutter_stripe: 
  git: 
    url: https://github.com/flutter-stripe/flutter_stripe.git
    path: packages/stripe
    ref: 659b5288f3d3da5ce1e2fd3ade1bc9fc24d4cf64 # latest master

I get you but your going to have to make a dicision like I had to, also moving to null safetly is going to end up the same issues I'm seeing

@fluffy919
Copy link

pod 'Stripe', '~> 21.4'

I tried this and it solved my issue.

@mclark4386
Copy link

pod 'Stripe', '~> 21.4'

I tried this and it solved my issue.

Would you mind giving more info on this. I can't seem to get that to work.

@hkmsadek
Copy link

hkmsadek commented Sep 9, 2021

same issue :( anyone was able to solve?

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

No branches or pull requests