jonasbark / flutter_stripe_payment

[DISCONTINUED] A flutter plugin with stripe payment plugin integration
MIT License
308 stars 243 forks source link

Flutter 2.0: framework not found Stripe #254

Open jpcarreira opened 3 years ago

jpcarreira commented 3 years ago

Since upgrading to Flutter 2.0 I wasn't able to build the project.

Launching lib/app/flavors/main_dev.dart on iPhone 12 mini in debug mode...
Xcode build done.                                           249.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.m:309:42: warning: comparison of distinct pointer types ('NSString *' and 'NSNull * _Nonnull') [-Wcompare-distinct-pointer-types]
        if (_stripeAccount && _stripeAccount != [NSNull null]) {
                              ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
    /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.m:731:42: warning: 'startPollingSourceWithId:clientSecret:timeout:completion:' is deprecated: You should poll your own backend to update based on source status change webhook events it may receive. [-Wdeprecated-declarations]
                            [stripeAPIClient startPollingSourceWithId:sourceID clientSecret:clientSecret timeout:10 completion:^(STPSource *source, NSError *error) {
                                             ^
    In module 'Stripe' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:11:
    /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods/Stripe/Stripe/PublicHeaders/STPAPIClient.h:370:243: note: 'startPollingSourceWithId:clientSecret:timeout:completion:' has been explicitly marked deprecated here
    - (void)startPollingSourceWithId:(NSString *)identifier clientSecret:(NSString *)secret timeout:(NSTimeInterval)timeout completion:(STPSourceCompletionBlock)completion NS_EXTENSION_UNAVAILABLE("Source polling is not available in extensions") DEPRECATED_MSG_ATTRIBUTE("You should poll your own backend to update based on source status change webhook events it may receive.");
                                                                                          ^
    In module 'Foundation' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/AvailabilityMacros.h:183:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.m:798:20: warning: 'setPublishableKey:' is deprecated: If you used [STPPaymentConfiguration sharedConfiguration].publishableKey, use [STPAPIClient sharedClient].publishableKey instead. If you passed a STPPaymentConfiguration instance to an SDK component, create an STPAPIClient, set publishableKey on it, and set the SDK component's APIClient property. [-Wdeprecated-declarations]
        [configuration setPublishableKey:nextPublishableKey];
                       ^
    In module 'Stripe' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:11:
    /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods/Stripe/Stripe/PublicHeaders/STPPaymentConfiguration.h:126:50: note: property 'publishableKey' is declared deprecated here
    @property (nonatomic, copy, readwrite) NSString *publishableKey DEPRECATED_MSG_ATTRIBUTE("If you used [STPPaymentConfiguration sharedConfiguration].publishableKey, use [STPAPIClient sharedClient].publishableKey instead. If you passed a STPPaymentConfiguration instance to an SDK component, create an STPAPIClient, set publishableKey on it, and set the SDK component's APIClient property.");
                                                     ^
    /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods/Stripe/Stripe/PublicHeaders/STPPaymentConfiguration.h:126:65: note: 'setPublishableKey:' has been explicitly marked deprecated here
    @property (nonatomic, copy, readwrite) NSString *publishableKey DEPRECATED_MSG_ATTRIBUTE("If you used [STPPaymentConfiguration sharedConfiguration].publishableKey, use [STPAPIClient sharedClient].publishableKey instead. If you passed a STPPaymentConfiguration instance to an SDK component, create an STPAPIClient, set publishableKey on it, and set the SDK component's APIClient property.");
                                                                    ^
    In module 'Foundation' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/AvailabilityMacros.h:183:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.m:1104:23: warning: 'metadata' is deprecated: Metadata is no longer returned to clients using publishable keys. Retrieve them on your server using yoursecret key instead. [-Wdeprecated-declarations]
                 TPSEntry(metadata),
                          ^
    In module 'Stripe' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:11:
    /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods/Stripe/Stripe/PublicHeaders/STPPaymentMethod.h:138:89: note: 'metadata' has been explicitly marked deprecated here
    @property (nonatomic, nullable, readonly) NSDictionary<NSString*, NSString *> *metadata DEPRECATED_MSG_ATTRIBUTE("Metadata is no longer returned to clients using publishable keys. Retrieve them on your server using yoursecret key instead.");
                                                                                          ^
    In module 'Foundation' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/AvailabilityMacros.h:183:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.m:1377:16: warning: 'metadata' is deprecated: Metadata is no longer returned to clients using publishable keys. Retrieve them on your server using yoursecret key instead. [-Wdeprecated-declarations]
        if (source.metadata) {
                   ^
    In module 'Stripe' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:11:
    /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods/Stripe/Stripe/PublicHeaders/STPSource.h:143:89: note: 'metadata' has been explicitly marked deprecated here
    @property (nonatomic, nullable, readonly) NSDictionary<NSString*, NSString *> *metadata DEPRECATED_MSG_ATTRIBUTE("Metadata is no longer returned to clients using publishable keys. Retrieve them on your server using yoursecret key instead.");
                                                                                          ^
    In module 'Foundation' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/AvailabilityMacros.h:183:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.m:1378:33: warning: 'metadata' is deprecated: Metadata is no longer returned to clients using publishable keys. Retrieve them on your server using yoursecret key instead. [-Wdeprecated-declarations]
            [result setValue:source.metadata forKey:@"metadata"];
                                    ^
    In module 'Stripe' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:11:
    /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods/Stripe/Stripe/PublicHeaders/STPSource.h:143:89: note: 'metadata' has been explicitly marked deprecated here
    @property (nonatomic, nullable, readonly) NSDictionary<NSString*, NSString *> *metadata DEPRECATED_MSG_ATTRIBUTE("Metadata is no longer returned to clients using publishable keys. Retrieve them on your server using yoursecret key instead.");
                                                                                          ^
    In module 'Foundation' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/AvailabilityMacros.h:183:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.m:1731:16: warning: 'STPBillingAddressFieldsZip' is deprecated: Use STPBillingAddressFieldsPostalCode [-Wdeprecated-declarations]
            return STPBillingAddressFieldsZip;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
                   STPBillingAddressFieldsPostalCode
    In module 'Stripe' imported from /Users/joaocarreira/.pub-cache/hosted/pub.dartlang.org/stripe_payment-1.0.9/ios/Classes/TPSStripeManager.h:11:
    /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods/Stripe/Stripe/PublicHeaders/STPAddress.h:48:47: note: 'STPBillingAddressFieldsZip' has been explicitly marked deprecated here
        STPBillingAddressFieldsZip __attribute__((deprecated("Use STPBillingAddressFieldsPostalCode", "STPBillingAddressFieldsPostalCode"))) = STPBillingAddressFieldsPostalCode,
                                                  ^
    7 warnings generated.
    ../../../../.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-0.2.0/lib/src/material_with_modal_page_route.dart:21:16: Error: Getter not found: 'opaque'.
            assert(opaque),
                   ^^^^^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-0.2.0/lib/src/bottom_sheets/cupertino_bottom_sheet.dart:339:46: Error: No named parameter with the name 'shadowThemeOnly'.
        final isCupertinoApp = Theme.of(context, shadowThemeOnly: true) == null;
                                                 ^^^^^^^^^^^^^^^
    ../../../../flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the arguments don't match.
      static ThemeData of(BuildContext context) {
                       ^^
    ../../../../.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-0.2.0/lib/src/bottom_sheets/material_bottom_sheet.dart:40:32: Error: No named parameter with the name 'shadowThemeOnly'.
          theme: Theme.of(context, shadowThemeOnly: true),
                                   ^^^^^^^^^^^^^^^
    ../../../../flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the arguments don't match.
      static ThemeData of(BuildContext context) {
                       ^^
    Command PhaseScriptExecution failed with a nonzero exit code
    building file list ... rsync: link_stat "/Users/joaocarreira/Repos/Work/YourSpace/your_space/build/ios/Debug-dev-iphonesimulator/App.framework" failed: No such file or directory (2)
    done
    sent 29 bytes  received 20 bytes  98.00 bytes/sec
    total size is 0  speedup is 0.00
    rsync error: some files could not be transferred (code 23) at /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(996) [sender=2.6.9]
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 12 mini.
Exited (sigterm)

When attempting to build and run from Xcode directly I run into the following:

Ld /Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Intermediates.noindex/Pods.build/Debug-dev-iphonesimulator/stripe_payment.build/Objects-normal/x86_64/Binary/stripe_payment normal x86_64 (in target 'stripe_payment' from project 'Pods')
    cd /Users/joaocarreira/Repos/Work/YourSpace/your_space/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios10.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -L/Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Products/Debug-dev-iphonesimulator/stripe_payment -F/Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Products/Debug-dev-iphonesimulator/stripe_payment -F/Users/joaocarreira/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-x86_64-simulator -F/Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Products/Debug-dev-iphonesimulator/Stripe -filelist /Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Intermediates.noindex/Pods.build/Debug-dev-iphonesimulator/stripe_payment.build/Objects-normal/x86_64/stripe_payment.LinkFileList -install_name @rpath/stripe_payment.framework/stripe_payment -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Intermediates.noindex/Pods.build/Debug-dev-iphonesimulator/stripe_payment.build/Objects-normal/x86_64/stripe_payment_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework Flutter -framework Foundation -framework Stripe -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Intermediates.noindex/Pods.build/Debug-dev-iphonesimulator/stripe_payment.build/Objects-normal/x86_64/stripe_payment_dependency_info.dat -o /Users/joaocarreira/Library/Developer/Xcode/DerivedData/Runner-cjfegludodozrwfpyykzpmnjmypj/Build/Intermediates.noindex/Pods.build/Debug-dev-iphonesimulator/stripe_payment.build/Objects-normal/x86_64/Binary/stripe_payment

ld: framework not found Stripe
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My flutter doctor is the following:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-PT)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.54.1)
[✓] Connected device (2 available)
    ! Error: Apple TV is not connected. Xcode will continue when Apple TV is connected. (code -13)
    ! Error: iPhone de Ana is not connected. Xcode will continue when iPhone de Ana is connected. (code -13)
    ! Error: João's iPhone is not connected. Xcode will continue when João's iPhone is connected. (code -13)

• No issues found!

Any help is appreciated!

EdHourani commented 3 years ago

Just finished fixing somthing similar in my project, 2 things to look at that may help:

  1. i ran into "'Stripe/Stripe.h' file not found" error when installing pods. Fixed this by updating flutter_stripe_payment verstion to 1.0.10 (latest) in pubspec.yaml
  2. i had a couple of issues similar to this:
    ../../../../.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-0.2.0/lib/src/bottom_sheets/cupertino_bottom_sheet.dart:339:46: Error: No named parameter with the name 'shadowThemeOnly'.
        final isCupertinoApp = Theme.of(context, shadowThemeOnly: true) == null;

    i had to update those packages, and in some cases use other packages (as they werent being maintained anymore).

so updating flutter_stripe_payment version, and resolving all the issues that where in the .pub-cache/hosted/ directory fixed this in my case

jpcarreira commented 3 years ago

@EdHourani did exactly what you did: I force-bumped a lot of dependencies, had an issue with modal bottom sheet like you mentioned in 2). This, together is using 1.0.10 for this lib solved it for me.

jamesblasco commented 3 years ago

Hello! I am the principal maintainer of the modal bottom sheet package. With Flutter 2.0, there have been some breaking changes. You can use the latest version of the package that also supports null safety: modal_bottom_sheet: ^2.0.0

Let me know if you have more problems :)