square / in-app-payments-flutter-plugin

Flutter Plugin for Square In-App Payments SDK
https://developer.squareup.com/docs
Apache License 2.0
340 stars 121 forks source link

iOS Build failure #229

Closed chanan closed 1 year ago

chanan commented 1 year ago

I added the plug-in and I am able to load and run the app in Android Studio in the emulator.

In xcode, I made the two changes mentioned in the Getting Started Page; change the iOS deployment target to 12 and added the Run Script.

I built the app for iOS using codemagic and the build fails. The log is below:

Running pod install...                                              8.7s
Running Xcode build...                                          
Xcode archive done.                                         56.6s
Failed to build iOS app
Error output from Xcode build:
↳
    2023-09-02 23:00:18.951 xcodebuild[2439:31810] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
    ** ARCHIVE FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/w2/rrf5p87d1bbfyphxc7jdnyvh0000gn/T/flutter_tools.ypB4gr/flutter_ios_build_temp_dirAMlhdu/temporary_xcresult_bundle

    In file included from /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/SquareInAppPaymentsFlutterPlugin.m:19:
    /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/FSQIPApplePay.h:23:53: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
    /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/FSQIPApplePay.h:23:53: note: insert '_Nullable' if the pointer may be null
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
                                                         _Nullable
    /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/FSQIPApplePay.h:23:53: note: insert '_Nonnull' if the pointer should never be null
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
                                                         _Nonnull
    1 warning generated.
    In file included from /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/FSQIPApplePay.m:17:
    /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/FSQIPApplePay.h:23:53: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
    /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/FSQIPApplePay.h:23:53: note: insert '_Nullable' if the pointer may be null
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
                                                         _Nullable
    /Users/builder/.pub-cache/hosted/pub.dev/square_in_app_payments-1.7.6/ios/Classes/FSQIPApplePay.h:23:53: note: insert '_Nonnull' if the pointer should never be null
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
                                                         _Nonnull
    1 warning generated.
    ld: warning: dylib (/Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/SquareBuyerVerificationSDK/SquareBuyerVerificationSDK.framework/SquareBuyerVerificationSDK) was built for newer iOS version (14.0) than being linked (12.0)
    ld: warning: dylib (/Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/SquareInAppPaymentsSDK/SquareInAppPaymentsSDK.framework/SquareInAppPaymentsSDK) was built for newer iOS version (14.0) than being linked (12.0)
    While building module 'square_in_app_payments' imported from /Users/builder/clone/ios/Runner/GeneratedPluginRegistrant.m:28:
    In file included from <module-includes>:1:
    In file included from /Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/square_in_app_payments/square_in_app_payments.framework/Headers/square_in_app_payments-umbrella.h:17:
    /Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/square_in_app_payments/square_in_app_payments.framework/Headers/FSQIPApplePay.h:23:53: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
    /Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/square_in_app_payments/square_in_app_payments.framework/Headers/FSQIPApplePay.h:23:53: note: insert '_Nullable' if the pointer may be null
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
                                                         _Nullable
    /Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/square_in_app_payments/square_in_app_payments.framework/Headers/FSQIPApplePay.h:23:53: note: insert '_Nonnull' if the pointer should never be null
    - (void)initWithMethodChannel:(FlutterMethodChannel *)channel;
                                                        ^
                                                         _Nonnull
    1 warning generated.
    1 warning generated.
    ld: warning: dylib (/Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/SquareBuyerVerificationSDK/SquareBuyerVerificationSDK.framework/SquareBuyerVerificationSDK) was built for newer iOS version (14.0) than being linked (12.0)
    ld: warning: dylib (/Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/SquareInAppPaymentsSDK/SquareInAppPaymentsSDK.framework/SquareInAppPaymentsSDK) was built for newer iOS version (14.0) than being linked (12.0)
    /Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-5ABB16BB2AA3F411007D55F7.sh: line 3: /Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Runner.app/Frameworks/SquareInAppPaymentsSDK.framework/setup: No such file or directory
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Building targets in dependency order
    /Users/builder/clone/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'FMDB' from project 'Pods')
    note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
    note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')

    Result bundle written to path:
        /var/folders/w2/rrf5p87d1bbfyphxc7jdnyvh0000gn/T/flutter_tools.ypB4gr/flutter_ios_build_temp_dirAMlhdu/temporary_xcresult_bundle

Encountered error while archiving for device.

Build failed :|
Failed to build for iOS
CharmisG commented 1 year ago

@chanan Have you followed all the steps below? https://github.com/square/in-app-payments-flutter-plugin/blob/master/doc/get-started.md

chanan commented 1 year ago

As far as I can tell, the relevant parts are in step 2 - setting the deployment iOS target and the build script. I have done those.

brandonjenniges commented 1 year ago

@chanan Can you check if the run script you added from step 2 is after any other build phases (mainly the [CP] Embed Pods Framework one)?

Screenshot 2023-09-28 at 10 17 05 AM

brandonjenniges commented 1 year ago

Closing this issue. Let me know if that didn't fix your issue.