1

This might be a lot and might be an edge case, but any info how to combat this error will be valuable for us.

We have integrated the latest version of the iOS Learning App with Marketing Cloud and it works fine:

  • contacts pass registration and appear in SFMC
  • push notifications are delivered
  • inbox messages are delivered
  • In-App Messages are displayed correctly most of the time and there's one specific case that has us baffled
iOS 12.X iOS 13.X iOS 14.5
Full-Page OK OK OK
Modal OK OK OK
Banner OK OK App Crashes

As you can see the Banner layout crashes the Learning App on iOS 14.5 which happens to be the current version of the system. This makes us worry about banner-style messages not being viable for production versions of the app.

Has anyone else encountered this issue? Is there some sort of configuration that could stop the app from crashing when loading a banner-style In-App message on iOS 14.x?


For reference, here's a log documenting the app crash provided by our iOS developer (captured in the simulator, which functions properly with layout other than banners):

MarketingCloudSDKInboxMessage.m
line: 513
2021-05-10 15:18:29.624215+0200 LearningApp[13586:385645] A constraint factory method was passed a nil layout anchor.  This is not allowed, and may cause confusing exceptions. Break on BOOL _NSLayoutConstraintToNilAnchor(void) to debug.  This will be logged only once.  This may break in the future.
2021-05-10 15:18:29.629871+0200 LearningApp[13586:385645] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSLayoutConstraint for <NSLayoutXAxisAnchor:0x600001609980 "InAppMessageLabel:0x15fe3b7b0.trailing">: A constraint cannot be made from <NSLayoutXAxisAnchor:0x600001609980 "InAppMessageLabel:0x15fe3b7b0.trailing"> to a constant. Location anchors require being paired.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001803f7978 __exceptionPreprocess + 236
    1   libobjc.A.dylib                     0x0000000180188800 objc_exception_throw + 56
    2   CoreAutoLayout                      0x00000001b552c5b8 _NSExceptionPrefix + 0
    3   MarketingCloudSDK                   0x00000001028094a0 -[InAppMessageUIViewController setupTitleLabelConstraints:] + 1252
    4   MarketingCloudSDK                   0x000000010280e750 -[InAppMessageUIViewController viewDidLayoutSubviews] + 880
    5   UIKitCore                           0x00000001848e5b64 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 3008
    6   QuartzCore                          0x00000001875565dc -[CALayer layoutSublayers] + 288
    7   QuartzCore                          0x000000018755ccb0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 528
    8   QuartzCore                          0x0000000187567fd0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 124
    9   QuartzCore                          0x00000001874bcc58 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 492
    10  QuartzCore                          0x00000001874e777c _ZN2CA11Transaction6commitEv + 672
    11  UIKitCore                           0x000000018441f18c _afterCACommitHandler + 140
    12  CoreFoundation                      0x0000000180364fc4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    13  CoreFoundation                      0x000000018035f73c __CFRunLoopDoObservers + 556
    14  CoreFoundation                      0x000000018035fc9c __CFRunLoopRun + 976
    15  CoreFoundation                      0x000000018035f3bc CFRunLoopRunSpecific + 572
    16  GraphicsServices                    0x000000018afdd70c GSEventRunModal + 160
    17  UIKitCore                           0x00000001843f03d0 -[UIApplication _run] + 964
    18  UIKitCore                           0x00000001843f51ac UIApplicationMain + 112
    19  LearningApp                         0x0000000102330ffc main + 84
    20  libdyld.dylib                       0x0000000180224554 start + 4
)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSLayoutConstraint for <NSLayoutXAxisAnchor:0x600001609980 "InAppMessageLabel:0x15fe3b7b0.trailing">: A constraint cannot be made from <NSLayoutXAxisAnchor:0x600001609980 "InAppMessageLabel:0x15fe3b7b0.trailing"> to a constant. Location anchors require being paired.'
terminating with uncaught exception of type NSException
CoreSimulator 757.5 - Device: iPhone 8 (6631233C-191C-4DAD-B660-466E1E3959AF) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 8
9
  • 1
    Do you have an open support case?
    – Bill Mote
    May 12 at 13:59
  • Hi, @BillMote, yes, we do have an open support case for this at the moment, but got no response on it yet May 12 at 14:05
  • 1
    Please have them at-mention me on the case so I can get it directed to my team.
    – Bill Mote
    May 12 at 19:40
  • 1
    I have been mentioned and am getting this prioritized for an iOS engineer on our team.
    – Bill Mote
    May 13 at 12:12
  • 1
    @Rafał Wolsztyniak, I will be looking into this for you once the investigation is brought to our team. To help expedite the process, please ensure you provide the SDK's State from the device where this issue is occurring. That can be printed out by the iOS dev by calling the sfmc_getSDKState() capturing the output of that method. Thanks! May 13 at 16:20
1

This issue was resolved in v7.5.1 of the iOS SDK. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.