Issue initializing the Square Reader SDK in iOS / Swift project

Hi Folks, hoping someone might be able to point me in the right direction with an issue.

I was able to successfully clone the ReaderSDKSample project, go through the configuration and setup of the project locally (get repo password, download and install the SDK, etc.) and take a live credit card payment via the card reader on an iPad Mini.

I’m subsequently trying to create a new project from scratch, to get to the same point, however I am running into an error when trying to initialize the SDK in my AppDelegate.

SQRDReaderSDK.initialize(applicationLaunchOptions: launchOptions)

I’m seeing a whole screed of ‘Failed to load optimized model path’ error messages, per below,

**CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/082F0E1C-6B76-423B-B496-CF7F3C50F0F3/TestPermissionsRequest.app/Frameworks/SquareReaderSDK.framework/SquareAccountResources.bundle/Accounts.momd/Accounts.omo'**

**CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/082F0E1C-6B76-423B-B496-CF7F3C50F0F3/TestPermissionsRequest.app/Frameworks/SquareReaderSDK.framework/LobLogResources.bundle/LogEvent.momd/LogEvent.omo'**

**CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/082F0E1C-6B76-423B-B496-CF7F3C50F0F3/TestPermissionsRequest.app/Frameworks/SquareReaderSDK.framework/SquareTransactionsResources.bundle/StoredPayments.momd/StoredPayments 3.omo'**

**CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/082F0E1C-6B76-423B-B496-CF7F3C50F0F3/TestPermissionsRequest.app/Frameworks/SquareReaderSDK.framework/SquareTransactionsResources.bundle/Transactions.momd/Transactions.omo'**

**CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/082F0E1C-6B76-423B-B496-CF7F3C50F0F3/TestPermissionsRequest.app/Frameworks/SquareReaderSDK.framework/SquareTransactionsResources.bundle/Payer.momd/Payer.omo'**

**CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/082F0E1C-6B76-423B-B496-CF7F3C50F0F3/TestPermissionsRequest.app/Frameworks/SquareReaderSDK.framework/SquareAccountResources.bundle/Accounts.momd/Accounts.omo'**

**2020-07-21 12:42:14.568315-0400 TestPermissionsRequest[1124:767165] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /private/var/mobile/Containers/Data/Application/042FD3F7-6718-4108-838A-88A8859E7606/Library/Application Support/SquareReaderSDK/RegisterAccounts.sqlite**

**2020-07-21 12:42:14.568514-0400 TestPermissionsRequest[1124:767165] [logging] invalidated open fd: 14 (0x11)**

**2020-07-21 12:42:14.571172-0400 TestPermissionsRequest[1124:767180] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /private/var/mobile/Containers/Data/Application/042FD3F7-6718-4108-838A-88A8859E7606/Library/Application Support/SquareReaderSDK/RegisterAccounts.sqlite-shm**

**2020-07-21 12:42:14.571437-0400 TestPermissionsRequest[1124:767180] [logging] invalidated open fd: 16 (0x11)**

**2020-07-21 12:42:14.573968-0400 TestPermissionsRequest[1124:767180] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /private/var/mobile/Containers/Data/Application/042FD3F7-6718-4108-838A-88A8859E7606/Library/Application Support/SquareReaderSDK/RegisterAccounts.sqlite-wal**

**2020-07-21 12:42:14.574165-0400 TestPermissionsRequest[1124:767180] [logging] invalidated open fd: 15 (0x11)**

I’ve recreated the project from scratch twice and get the same errors each time. I’m probably missing something glaringly obvious, but would greatly appreciate any insight if someone has seen this before!

Many thanks,

Shaun Hurley

Hi @shaunhurley welcome to the forums!

  1. What version of Reader SDK are you using?
  2. What version of XCode are you using?
  3. What version of iOS is your device running?
  4. If you run on a simulator device, does it still throw these errors?
  1. Most recent version of Reader SDK (as in, fresh install this morning for my test project) so v1.3.8
  2. Xcode is current, version 11.6
  3. Targeting a physical iPad Mini 2 with the latest available iOS (12.4.7) and/or a iPad Mini 2 simulator with 12.4 - note: the physical device is the one that I am able to run the Square sample app on with no issues.
  4. Yep, see exactly the same error on both physical device and simulator.

Thanks!

Shaun

Thanks for providing that. Would you be willing to share your project (I know you said it’s very barebones, but just want to make sure we are seeing what you’re seeing)? Feel free to DM it to me (click my name -> “Message”) if you don’t want it in the public forums. If not, I’ll see what we can do but it may be harder for us to replicate it.

No issue sharing at all. I can’t see a message option (maybe I’ve not been here long enough?) but I just created an public origin on GitHub @ https://github.com/shaunhurley/TestPermissionsRequest

Note: the SDK framework is excluded from the repo, I’d sort of assumed that the download was signed somehow (based on the installation process i.e. requiring app id and repo password) so you guys can track who is doing what with it, so figured better not to include and make public?

Thanks, this is great. I am seeing the same logs as you, however it doesn’t seem to be preventing it from working (it still continues running and initializes successfully as far as I can see). It seems these are just warnings, not errors, so it should be OK to ignore them as far as I can tell. Let me know if I’m misunderstanding, though.

Hmm, Ok, I’ll keep forging ahead and seeing what happens - I just assumed from the invalid API calls that something was broken… thanks for taking a look!

1 Like