flutter_stripe_payment
flutter_stripe_payment copied to clipboard
Build failure on macOS 11.3 and Xcode 12.5
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)
Confirm, having the same issue.
same issue after updating to Xcode 12.5
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)
Same :( It seems it's the Stripe 19.4.0 dependency. Any ideas on how to force update to 19.4.1?
Downgrading to XCODE 12.4 solved the issue
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)
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
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?
Have you tried to run pod update
within iOS directory? I also noticed that it does not run within simulator for what ever reason.
tried pod update... but getting same issue on both simulator and physical iPhone.
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
andpod update
(you might need to dopod 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.
@mathatan I'm going to downgrade XCODE to 12.04
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'
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 :)
Same problem to me. Should i wait or downgrade to 12.4?
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.
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?
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 )
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.
@jonasbark This is a good new! I will test the new plugin straight away!
do you have a timeline for google pay in the migration?
Do we use flutter_stripe_payment
or flutter_stripe
or stripe_payment
? I'm confusion
Do we use
flutter_stripe_payment
orflutter_stripe
orstripe_payment
? I'm confusion
hey used stripe_payment_flutter in the interim and got it all working last week
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
stripe_payment_flutter
has the same problems as this package for me. Migrating toflutter_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
pod 'Stripe', '~> 21.4'
I tried this and it solved my issue.
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.
same issue :( anyone was able to solve?