eopeter / flutter_stripe_payment

Add Stripe Payments to Flutter Application
Other
29 stars 27 forks source link

Error build iOS #1

Closed matte5031 closed 5 years ago

matte5031 commented 5 years ago

Hello

Thanks for a great plugin, tried it on Android and seems to work good. Tried to build on iOS I get the following error when I tried to build. You know how this can be solved @eopeter ? thanks!

[!] Unable to determine Swift version for the following pods:

- `flutter_stripe_payment` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute
set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.

/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer/xcode/target_validator.rb:122:in
`verify_swift_pods_swift_version'
/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:578:in `validate_targets'
/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:158:in `install!'
/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/command/install.rb:51:in `run'
/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/bin/pod:55:in `<top (required)>'
/usr/local/Cellar/cocoapods/1.7.5/libexec/bin/pod:22:in `load'
/usr/local/Cellar/cocoapods/1.7.5/libexec/bin/pod:22:in `<main>'
eopeter commented 5 years ago

In your Xcode Build Settings, set the Swift Language Version. Does that work?

On Fri, Sep 20, 2019 at 3:39 AM matte5031 notifications@github.com wrote:

Hello

Thanks for a great plugin, tried it on Android and seems to work good. Tried to build on iOS I get the following error when I tried to build. You know how this can be solved @eopeter https://github.com/eopeter ? thanks!

[!] Unable to determine Swift version for the following pods:

  • flutter_stripe_payment does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

/usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer/xcode/target_validator.rb:122:in verify_swift_pods_swift_version' /usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer/xcode/target_validator.rb:37:invalidate!' /usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:578:in validate_targets' /usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:158:ininstall!' /usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/command/install.rb:51:in run' /usr/local/Cellar/cocoapods/1.7.5/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:inrun' /usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:52:in run' /usr/local/Cellar/cocoapods/1.7.5/libexec/gems/cocoapods-1.7.5/bin/pod:55:in<top (required)>' /usr/local/Cellar/cocoapods/1.7.5/libexec/bin/pod:22:in load' /usr/local/Cellar/cocoapods/1.7.5/libexec/bin/pod:22:in

'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eopeter/flutter_stripe_payment/issues/1?email_source=notifications&email_token=AAPLOM6QNLWPUSJJSAB362DQKR423A5CNFSM4IYT2CY2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HMTMKPQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPLOMYYTKJGMFGZRO4WQGDQKR423ANCNFSM4IYT2CYQ .

-- Sincerely Emmanuel Oche

matte5031 commented 5 years ago

@eopeter Thanks, I tried that and now it builds for longer and almost finishes! Which swift version do you use? I tried 4.0 and 4.2, in the last step of the build I get this error now:

Xcode build done. 22.5s Failed to build iOS app Error output from Xcode build: ↳ BUILD FAILED

Xcode's output: ↳ ~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripepayment-0.0.4/ios/Classes/SwiftFlutterStripePaymen tPlugin.swift:89:38: error: incorrect argument labels in call (have ':with:_:', expected 'withParams:authenticationContext:completion:') paymentManager.confirmPayment(paymentIntentParams, with: self) { (status, paymentIntent, error) in ^ ~~~~ withParams: authenticationContext ~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripepayment-0.0.4/ios/Classes/SwiftFlutterStripePaymen tPlugin.swift:114:42: error: incorrect argument labels in call (have ':with:_:', expected 'withParams:authenticationContext:completion:') paymentManager.confirmSetupIntent(setupIntentConfirmParams, with: self) { (status, paymentIntent, error) in ^ ~~~~ withParams: authenticationContext ~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe_payment-0.0.4/ios/Classes/SwiftFlutterStripePaymen tPlugin.swift:170:113: warning: left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used var paymentResponse: [String : Any] = ["status":"succeeded", "paymentMethodId" : paymentMethod.stripeId ?? ""]



~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe_payment-0.0.4/ios/Classes/SwiftFlutterStripePaymen
    tPlugin.swift:170:13: warning: variable 'paymentResponse' was never mutated; consider changing to 'let' constant
            var paymentResponse: [String : Any] = ["status":"succeeded", "paymentMethodId" : paymentMethod.stripeId ?? ""]
            ~~~ ^
            let
    Command CompileSwift failed with a nonzero exit code
    note: Using new build systemnote: Planning buildnote: Constructing build description

Encountered error while building for device.
eopeter commented 5 years ago

It seems you may have ran "pods update", which will have updated to the latest stripe pods greater than what the plugin is using. I will do an update to the plugin and cap the version, so a "pods update" won’t break it. For now, you could delete your podfile.lock in your iOS folder of your Flutter project and run “pods install” in terminal or wait for the plugin update

On Sep 20, 2019, at 4:19 AM, matte5031 notifications@github.com wrote:

@eopeter https://github.com/eopeter Thanks, I tried that and now it builds for longer and almost finishes! However in the last step of the build I get this error now:

Xcode build done. 22.5s Failed to build iOS app Error output from Xcode build: ↳ BUILD FAILED

Xcode's output: ↳ ~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe_payment-0.0.4/ios/Classes/SwiftFlutterStripePaymen tPlugin.swift:89:38: error: incorrect argument labels in call (have ':with::', expected 'withParams:authenticationContext:completion:') paymentManager.confirmPayment(paymentIntentParams, with: self) { (status, paymentIntent, error) in ^ ~~~~ withParams: authenticationContext ~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe_payment-0.0.4/ios/Classes/SwiftFlutterStripePaymen tPlugin.swift:114:42: error: incorrect argument labels in call (have ':with::', expected 'withParams:authenticationContext:completion:') paymentManager.confirmSetupIntent(setupIntentConfirmParams, with: self) { (status, paymentIntent, error) in ^ ~~~~ withParams: authenticationContext ~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe_payment-0.0.4/ios/Classes/SwiftFlutterStripePaymen tPlugin.swift:170:113: warning: left side of nil coalescing operator '??' has non-optional type 'String', so the right side is never used var paymentResponse: [String : Any] = ["status":"succeeded", "paymentMethodId" : paymentMethod.stripeId ?? ""]



~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe_payment-0.0.4/ios/Classes/SwiftFlutterStripePaymen
tPlugin.swift:170:13: warning: variable 'paymentResponse' was never mutated; consider changing to 'let' constant
        var paymentResponse: [String : Any] = ["status":"succeeded", "paymentMethodId" : paymentMethod.stripeId ?? ""]
        ~~~ ^
        let
Command CompileSwift failed with a nonzero exit code
note: Using new build systemnote: Planning buildnote: Constructing build description
Encountered error while building for device.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <https://github.com/eopeter/flutter_stripe_payment/issues/1?email_source=notifications&email_token=AAPLOMZ5G55JRA76GMWPUUDQKSBPTA5CNFSM4IYT2CY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7F6XSA#issuecomment-533457864>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAPLOM3NNSDS5MDQ5MSEKD3QKSBPTANCNFSM4IYT2CYQ>.
matte5031 commented 5 years ago

@eopeter That's correct, I had, however I've tried now deleting the lock file and also tried with deleting the full pods file, tried pod clean aswell, and just ran pod install. I still get the same error unfortunately

eopeter commented 5 years ago

I updated the plugin with the most up to date Stripe pods and fixed the code issue.

matte5031 commented 5 years ago

@eopeter The build was successful now! I tried installing the app on the device and it crashes instantly, will check if it is because of this plugin or not!

matte5031 commented 5 years ago

Okay so the crash does not seem to be because of the plugin, will try to find what's causing that. Thanks! Not all heroes wear capes

eopeter commented 5 years ago

Ok, let me know if you are having any other issues with the plugin.