Errors related to SquareReader framework for iOS when building project in Xcode

Hello,

Some of my colleagues are seeing errors related to the squarereadersdk when building our app on Xcode:

ld: warning: ignoring file /Users/temp/code/myapp/Pods/SquareReaderSDK/SquareReaderSDK.framework/SquareReaderSDK, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F )
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SQRDTender", referenced from:
      objc-class-ref in SquareService.o
  "_OBJC_CLASS_$_SQRDReaderSDK", referenced from:
      objc-class-ref in SquareService.o
  "_OBJC_CLASS_$_SQRDReaderSettingsController", referenced from:
      objc-class-ref in SquareService.o
  "_OBJC_CLASS_$_SQRDMoney", referenced from:
      objc-class-ref in SquareService.o
  "_OBJC_CLASS_$_SQRDCheckoutController", referenced from:
      objc-class-ref in SquareService.o
  "_OBJC_CLASS_$_SQRDCheckoutParameters", referenced from:
      objc-class-ref in SquareService.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

We’ve been trying for days to fix this. From cloning a brand new project to re-installing cocoapods, playing with the Xcode settings etc.

By the way, we are using the following version: pod 'SquareReaderSDK', '1.4.8'

Any help is appreciated.

Thanks.

Hi @rdrch welcome to the forums!

What version of XCode are you using? Also, Square Reader SDK doesn’t currently support Cocoa Pods as far as I’m aware, so I’m not sure where you’re getting the pod from. In our documentation we require you to run a ruby command to download the Reader SDK framework: https://developer.squareup.com/docs/reader-sdk/build-on-ios#step-2-install-reader-sdk.

Hi @sjosey,

Thanks for the prompt reply.

We use Xcode 11.7 and yes, you are right. What we did was install the SquareReaderSDK on a private pod and use it on our app via Cocoapods.

Thanks! I discussed this with a member of our iOS team and they mentioned it could be due to derived data within Xcode. Could you try deleting your derived data in Xcode and see if the issue is resolved? Here’s some info on how to do this just in case: https://stackoverflow.com/a/42760524.

I did that already and unfortunately the errors didn’t clear up. I deleted derived data, cleaned the project, deintegrated pods, re-ran pod install, and still same errors are showing.

It seems to be related to git lfs not being setup correctly.

Should we track specific framework files with git lfs? If yes, could you advise which ones?

Thanks!

I encountered the same error and due to an improperly configured Git LFS install. You can confirm that that’s the problem by choosing the library in the File Navigator in Xcode. On a properly downloaded binary Xcode will show the default white paper icon. For an incorrectly configured Git LFS install Xcode will correctly surmise that the file is not a binary and show the git=lfs metadata:

If you run git lfs env in the terminal and have this at the bottom of the output:

git config filter.lfs.process = ""
git config filter.lfs.smudge = ""
git config filter.lfs.clean = ""

That’s the issue. You can fix it by running the following commands in the terminal and re-cloning:

git config --global filter.lfs.required true
git config --global filter.lfs.clean "git-lfs clean -- %f"
git config --global filter.lfs.smudge "git-lfs smudge -- %f"
git config --global filter.lfs.process "git-lfs filter-process"

To add to phughes’s post, if git lfs is used in a private pod, after executing the commands above, you have to run pod cache clean 'podname' --all (after deintegrating the pod in question) and reinstall the pod.

If you are experiencing any errors related to the SquareReader framework for iOS when building your project in Xcode, it is likely that you are using an older version of the framework. Please ensure that you are using the latest version of the SquareReader framework by following the instructions in the Square Reader SDK for iOS Getting Started guide.