Square Data Error: Failed to create file [Square Reader SDK: iOS]

Hello,

We are running into the following crash every once in a while upon launching the app:

Fatal Exception: NSInternalInconsistencyException

`SQUARE DATA ERROR: Could not add persistent store for SQRTransactionLedgerDataStoreController due to Error Domain=NSCocoaErrorDomain Code=512 "The file couldn’t be saved." UserInfo={reason=Failed to create file; code = 1}.`

This is happening on ‘app did finish launching’ and this is what our setup function looks like:

private func setupSquareReaderSDK(launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {

        let skipInitSquareSDK = ProcessInfo.processInfo.environment["SKIP_INIT_SQUARE_SDK"]
        if skipInitSquareSDK == nil || skipInitSquareSDK != "YES" {
            SQRDReaderSDK.initialize(applicationLaunchOptions: launchOptions)
        }
    }

What is causing this? Could that be a bug with the SDK? It’s only happening to some of our users.

Any help would be appreciated.
Thanks.

:wave: At this time we are continuing to monitor the frequency of this occurrences but do not at this time have a way to resolve the issue. If you are able to provide any additional reproduction steps that would be greatly appreciated in our investigation of this issue. :slightly_smiling_face:

1 Like