square / in-app-payments-flutter-plugin

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

Hey i was trying this plugin for in app payments and it's working great in android but facing issue in iOS #206

Closed Nikunj686 closed 1 year ago

Nikunj686 commented 1 year ago

Hey try this plugin for in app payments and it's working great in android and i can make entry through the backend services but while i was running this app in iOS with flutter run it's throws some error which i have attached below i have also try one of the solution with overriding the version of the dependency please help me out as i have production date very close.


Error output from Xcode build:
↳
    2022-11-16 12:51:45.888 xcodebuild[31427:166653] Requested but did not find extension point with identifier
    Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in
    com.apple.dt.IDEWatchSupportCore
    2022-11-16 12:51:45.889 xcodebuild[31427:166653] Requested but did not find extension point with identifier
    Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of
    plug-in com.apple.dt.IDEWatchSupportCore
    ** BUILD FAILED **

Xcode's output:
↳
Writing result bundle at path:
    /var/folders/rr/kxj5n0h57ljbbf0d3k1tbfzr0000gn/T/flutter_tools.MMoZbW/flutter_ios_build_temp_dirsthWFb/temporary_xcresult_bundle

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GeneratedPluginRegistrant", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order

Result bundle written to path:
    /var/folders/rr/kxj5n0h57ljbbf0d3k1tbfzr0000gn/T/flutter_tools.MMoZbW/flutter_ios_build_temp_dirsthWFb/temporary_xcresult_bundle

Error (Xcode): Undefined symbol: _OBJCCLASS$_GeneratedPluginRegistrant

Could not build the application for the simulator. Error launching application on iPhone 13 Pro Max.

CharmisG commented 1 year ago

Hey @Nikunj686

First try this below command, flutter upgrade rm -f ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rm -rf ios/Podfile ios/Podfile.lock ios/Pods ios/Runner.xcworkspace

and you are facing same issue then you need to exclude the arm64 architecture eveytime whenever you run the app on an iOS simulator.

Please try this link, https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/414#issuecomment-875717263

And let me know if you are facing same issue.

AkshayGuptaStack commented 1 year ago

Hey i am facing the same issue and tried your suggestion but didn't work

AkshayGuptaStack commented 1 year ago

Hey i thought the problem is with the simulator only you can run on real device and even you can build the ipa file.

CharmisG commented 1 year ago

yes @AkshayGuptaStack the issue is with simulator only and flutter-SDK itself facing same problem.

holailusoria commented 1 year ago

Same issue for simulator. For real device this working

    Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_SQIPApplePayNonceRequest", referenced from:
          objc-class-ref in FSQIPApplePay.o
      "_OBJC_CLASS_$_SQIPBuyerAction", referenced from:
          objc-class-ref in FSQIPCardEntry.o
      "_OBJC_CLASS_$_SQIPBuyerVerificationSDK", referenced from:
          objc-class-ref in FSQIPCardEntry.o
      "_OBJC_CLASS_$_SQIPCard", referenced from:
          __OBJC_$_CATEGORY_SQIPCard_$_FSQIPAdditions in SQIPCard+FSQIPAdditions.o
      "_OBJC_CLASS_$_SQIPCardDetails", referenced from:
          __OBJC_$_CATEGORY_SQIPCardDetails_$_FSQIPAdditions in SQIPCardDetails+FSQIPAdditions.o
      "_OBJC_CLASS_$_SQIPCardEntryViewController", referenced from:
          objc-class-ref in FSQIPCardEntry.o
      "_OBJC_CLASS_$_SQIPContact", referenced from:
          objc-class-ref in FSQIPCardEntry.o
      "_OBJC_CLASS_$_SQIPInAppPaymentsSDK", referenced from:
          objc-class-ref in FSQIPApplePay.o
          objc-class-ref in SquareInAppPaymentsFlutterPlugin.o
      "_OBJC_CLASS_$_SQIPMoney", referenced from:
          objc-class-ref in FSQIPCardEntry.o
      "_OBJC_CLASS_$_SQIPSecureRemoteCommerce", referenced from:
          objc-class-ref in FSQIPSecureRemoteCommerce.o
      "_OBJC_CLASS_$_SQIPTheme", referenced from:
          objc-class-ref in FSQIPCardEntry.o
      "_OBJC_CLASS_$_SQIPVerificationParameters", referenced from:
          objc-class-ref in FSQIPCardEntry.o
      "_SQIPErrorDebugCodeKey", referenced from:
          ___80-[FSQIPApplePay paymentAuthorizationViewController:didAuthorizePayment:handler:]_block_invoke in FSQIPApplePay.o
          ___64-[FSQIPCardEntry cardEntryViewController:didCompleteWithStatus:]_block_invoke.21 in FSQIPCardEntry.o
          ___110-[FSQIPCardEntry startBuyerVerificationFlow:buyerActionString:moneyMap:locationId:contactMap:paymentSourceId:]_block_invoke.52 in FSQIPCardEntry.o
          ___62-[FSQIPSecureRemoteCommerce startSecureRemoteCommerce:amount:]_block_invoke in FSQIPSecureRemoteCommerce.o
      "_SQIPErrorDebugMessageKey", referenced from:
          ___80-[FSQIPApplePay paymentAuthorizationViewController:didAuthorizePayment:handler:]_block_invoke in FSQIPApplePay.o
          ___64-[FSQIPCardEntry cardEntryViewController:didCompleteWithStatus:]_block_invoke.21 in FSQIPCardEntry.o
          ___110-[FSQIPCardEntry startBuyerVerificationFlow:buyerActionString:moneyMap:locationId:contactMap:paymentSourceId:]_block_invoke.52 in FSQIPCardEntry.o
          ___62-[FSQIPSecureRemoteCommerce startSecureRemoteCommerce:amount:]_block_invoke in FSQIPSecureRemoteCommerce.o
    ld: symbol(s) not found for architecture arm64
CharmisG commented 1 year ago

@holailusoria @AkshayGuptaStack @Nikunj686 ,

Basically for simulator,

you have to exclude arm64 for the simulator architecture, both from your project and the Pod project.

If you are using custom XCConfig files, you can simply add this line for excluding simulator architecture. EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64

after that, You have to do the same for the Pod project until all the Cocoa pod vendors are done adding following in their Podspec. s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator]' => 'arm64' } s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator]' => 'arm64' }

You can manually add the Excluded Architecture in your Pod project's Build Settings, but it will be overwritten when you use pod install.

In place of this, you can add this snippet in your Podfile. It will write the necessary Build Settings every time you run pod install.

post_install do |installer| installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end

Please refer this link , https://stackoverflow.com/questions/63607158/xcode-building-for-ios-simulator-but-linking-in-an-object-file-built-for-ios-f?rq=1

CharmisG commented 1 year ago

@holailusoria @AkshayGuptaStack @Nikunj686 I'm closing this issue hope you got your answer but if you are facing the same then please repopen this issue.

holailusoria commented 1 year ago

@CharmisG Problem was not resolved. Why you close this issue?

CharmisG commented 1 year ago

Hi @holailusoria , Sorry for inconvenience. We have not received any response on above solutions so we have closed the ticket. We have reopened the ticket. Please let us know if above solutions has worked for you or not.

CharmisG commented 1 year ago

@holailusoria

Following up on the above issue if solution has worked for you.