Xcode 12: Square Reader SDK crashes on init

Hello,

After installing Xcode 12, we are running into issues related to the square reader sdk. The app crashes when initializing the square reader sdk:

SQRDReaderSDK.initialize(applicationLaunchOptions: launchOptions)

with the following message:

Thread 1: "+[Event loadCustomEntityAdditionsInManagedObjectModel:]: unrecognized selector sent to class 0x115c82488"

Note that we didn’t see this crash in Xcode 11. I’ve tried reinstalling the framework but to no avail.

Any help is appreciated.

What version of Reader SDK are you using? For instance, Reader SDK 1.4.7 added a fix for compatibility with Xcode 12.3: https://developer.squareup.com/docs/changelog/mobile-logs/2021-02-03.

Hi @sjosey
I’m using SquareReaderSDK version 1.4.7. I’m also using Xcode 12.4 not Xcode 12.3.

Thanks for confirming. Let me follow up with our Reader SDK team. Just in case, can you provide your Square app id?

Yes, I can if needed.

Hi @sjosey
I tried running our app on Xcode 12.3 and I’m running into the same issue. It’s failing at SquareReaderSDK init.

@sjosey any update on this? It’s pretty time sensitive and I would appreciate if you guys could steer us in the right direction. Thanks.

Heard back from the team and they’ve been unable to reproduce so far. They tested with XCode 12.4. They suggested closing XCode and deleting the DerivedData folder and try rebuilding the app and see if that works.

We’ve done that already to no avail unfortunately.

Anything else that can steer us in the right direction? This is happening across multiple environments, not just mine.

I have just noticed warnings of this sort:

Class Event is implemented in both /private/var/containers/Bundle/Application/A0D715D1-7AB6-4647-814B-5A03440B3114/APP.app/Frameworks/XXX.framework/XXX (0x116f42488) and /private/var/containers/Bundle/Application/A0D715D1-7AB6-4647-814B-5A03440B3114/APP.app/Frameworks/SquareReaderSDK.framework/SquareReaderSDK (0x114517e60). One of the two will be used. Which one is undefined.

There are classes common to the SquareReaderSDK and other frameworks (installed manually and via cocoapods).

Thanks for the information. Are you using Objective C or Swift? Also, would you be able/willing to tell us what the other framework that has this naming collision is?

We are using both Objective-C and Swift. The name of the other framework is Google’s Protobuf which comes with Firebase.

Ok thanks! Would you be able to provide an example app with the crash happening so I can provide it to the team?

Hey @sjosey,
After investigating this further, I believe the issue to be related to the SquareReaderSDK and a framework called mmMobile. They both have an Event class and Xcode 12 seems to be having some issues with that:

objc[54958]: Class Event is implemented in both /Users/user/Library/Developer/CoreSimulator/Devices/B4816790-617D-4DBB-A2EB-9650A6CE43D9/data/Containers/Bundle/Application/8B62D497-C39B-43A4-BEA4-6E4B2F16D61E/APP.app/Frameworks/mmMobileSDK.framework/mmMobileSDK (0x112ab4168) and /Users/user/Library/Developer/CoreSimulator/Devices/B4816790-617D-4DBB-A2EB-9650A6CE43D9/data/Containers/Bundle/Application/8B62D497-C39B-43A4-BEA4-6E4B2F16D61E/APP.app/Frameworks/SquareReaderSDK.framework/SquareReaderSDK (0x10c947c70). One of the two will be used. Which one is undefined.

And this is the error:

Thread 1: "+[Event loadCustomEntityAdditionsInManagedObjectModel:]: unrecognized selector sent to class 0x115c82488"

This seems to indicate that the compiler is using the mmMobileSDK’s Event class instead of the SquareReaderSDK’s and it results in an unrecognized selector error.

Is there any way around this?

Thanks for sharing this information. Bringing this back to the team. Can you confirm what the “mmMobileSdk” actually is? Is that something from Amazon’s SDK?

@sjosey mmMobileSDK is a text-to-speech SDK from https://www.3m.com/ (formerly M*Modal)

Got it. Is it possible to provide a sample zipped file so we can test a theory on our side to see if it will resolve the issue?

Yes, I can do that. Would you be able to provide me with an email address so I can send you a box invite to download the file? I can also send you a link.