1

After Migrating the current mobile push SDK (iOS ) to the latest version, App started crashing on the launch with fatal exception NSInvalidArgumentException

+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'SFMCEndpointConfigurationEntity'

Logs:-

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                    0xa248 __exceptionPreprocess
1  libobjc.A.dylib                   0x17a68 objc_exception_throw
2  CoreData                          0x164b0 +[NSEntityDescription entityForName:inManagedObjectContext:]
3  CoreData                          0x1615c +[NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:]
4  MarketingCloudSDK                 0x4d29c (Missing UUID ce2e58bce280387abef8696cc9e70ce2)
5  MarketingCloudSDK                 0x59ed0 (Missing UUID ce2e58bce280387abef8696cc9e70ce2)
6  MarketingCloudSDK                 0x5fe60 (Missing UUID ce2e58bce280387abef8696cc9e70ce2)
7  MarketingCloudSDK                 0x5f664 (Missing UUID ce2e58bce280387abef8696cc9e70ce2)
8  Foundation                        0x3b000 __NSThreadPerformPerform
9  CoreFoundation                    0xd622c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
10 CoreFoundation                    0xe2614 __CFRunLoopDoSource0
11 CoreFoundation                    0x6657c __CFRunLoopDoSources0
12 CoreFoundation                    0x7beb8 __CFRunLoopRun
13 CoreFoundation                    0x811e4 CFRunLoopRunSpecific
14 GraphicsServices                  0x1368 GSEventRunModal
15 UIKitCore                         0x3a2d88 -[UIApplication _run]
16 UIKitCore                         0x3a29ec UIApplicationMain
17 Pilot Flying J: myRewards Plus    0x23475c main + 14 (main.m:14)
18 ???                               0x1daa7d948 (Missing)```

NSManagedObjectContext 0x2805e1380: workerContext_F97D9C6D-B78A-4C80-A6AB-7BF254B05AE6
0  libsystem_kernel.dylib         0x1680 __ulock_wait + 8
1  libdispatch.dylib              0x49cc _dlock_wait + 56
2  libdispatch.dylib              0x4780 _dispatch_thread_event_wait_slow + 56
3  libdispatch.dylib              0x13860 __DISPATCH_WAIT_FOR_QUEUE__ + 368
4  libdispatch.dylib              0x1340c _dispatch_sync_f_slow + 144
5  CoreData                       0xe3fd4 _perform + 204
6  CoreData                       0x17be38 -[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:] + 228
7  CoreData                       0xa3440 -[NSManagedObjectContext _countWithNoChangesForRequest:error:] + 260
8  CoreData                       0x153bc -[NSManagedObjectContext _countForFetchRequest_:error:] + 188
9  CoreData                       0xf9a3c -[NSManagedObjectContext countForFetchRequest:error:] + 24
10 MarketingCloudSDK              0x85408 __38-[SFMCDatabase count:inContext:error:]_block_invoke + 72
11 CoreData                       0x82c20 developerSubmittedBlockToNSManagedObjectContextPerform + 156
12 CoreData                       0x82770 -[NSManagedObjectContext performBlockAndWait:] + 208
13 MarketingCloudSDK              0x852e0 -[SFMCDatabase count:inContext:error:] + 216
14 MarketingCloudSDK              0x5dcec -[MarketingCloudSDKFoundation count:inContext:error:] + 112
15 MarketingCloudSDK              0xb1390 __106-[MarketingCloudSDKIntelligence(DeviceStatisticsItem) totalEventsCountFromDeviceStatsEntityWithPredicate:]_block_invoke + 188
16 CoreData                       0x82c20 developerSubmittedBlockToNSManagedObjectContextPerform + 156
17 libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
18 libdispatch.dylib              0x13574 _dispatch_lane_barrier_sync_invoke_and_complete + 56
19 CoreData                       0x827a8 -[NSManagedObjectContext performBlockAndWait:] + 264
20 MarketingCloudSDK              0xb1248 -[MarketingCloudSDKIntelligence(DeviceStatisticsItem) totalEventsCountFromDeviceStatsEntityWithPredicate:] + 252
21 MarketingCloudSDK              0xadc74 -[MarketingCloudSDKIntelligence(DeviceStatisticsItem) sendDeviceStatsItemAnalytics] + 288
22 MarketingCloudSDK              0x9d41c __50-[MarketingCloudSDKIntelligence sendAllAnalytics:]_block_invoke_2 + 36
23 MarketingCloudSDK              0x7819c __83+[SFMCTimedDispatcher dispatchWithIdentifier:onQueue:afterTimeInterval:completion:]_block_invoke + 92
24 libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
25 libdispatch.dylib              0x746c _dispatch_continuation_pop + 504
26 libdispatch.dylib              0x1aa58 _dispatch_source_invoke + 1588
27 libdispatch.dylib              0xb56c _dispatch_lane_serial_drain + 376
28 libdispatch.dylib              0xc1e0 _dispatch_lane_invoke + 384
29 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread + 652
30 libsystem_pthread.dylib        0xdf8 _pthread_wqthread + 288
31 libsystem_pthread.dylib        0xb98 start_wqthread + 8

1 Answer 1

1

Please pull in the MarketingCloudSDK.bundle file to the application target as mentioned in https://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/get-started/get-started-migration.html if SPM is used as dependency manager or

#5 in https://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/get-started/get-started-addsdk.html

This should resolve the issue

Thanks Prakashini

9
  • I have already done, that, and App is not crashing on the Dev env only it is crashing on the live application and the crash count is too huge. Commented Oct 13, 2022 at 4:44
  • If you have upgraded to 8.0.8 version, the existing bundle reference should be removed and add the latest. Not sure how is your live app built to reference the latest bundle. If you have two different targets to differentiate between dev and live, the bundle should be updated in both the target's Copy Bundle resources section under build phases. Commented Oct 13, 2022 at 5:52
  • @prkashini We have a single target with build config, and the crash numbers are high. not crashing on every device. we have added the latest bundle to the application, regarding the SDK setup everything is right. the SDK is behaving strangely. there is no proper documentation on Salesforce side to tackle these error Commented Oct 13, 2022 at 6:11
  • Even if they don't have examples using SPM. as they are saying to move to SPM and cocoa pods are discontinued then why they are using the cocoa pods in the example and not SPM? they should add an example with SPM Commented Oct 13, 2022 at 6:23
  • github.com/salesforce-marketingcloud/MarketingCloudSDK-iOS/tree/… is the link for SPM. Cocoapods is not discontinued, it is still supported. Commented Oct 13, 2022 at 6:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .