When the SDK is upgraded to latest version, there might be changes to the resources bundle (MarketingCloudSDK.bundle) that comes packaged with the SDK. If the right versions are not copied, the app crashes with the exception as the SDK might not find the required resources in the .bundle file.

Common Exceptions When latest MarketingCloudSDK.bundle not added in the application

NSInvalidArgumentException, NSInternalInconsistencyException

  1. +entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'SFMCEndpointConfigurationEntity'
  2. 'NSFetchRequest could not locate an NSEntityDescription for entity name 'SFMCEventConfigurationEntity''
  3. 'Cannot create an NSPersistentStoreCoordinator with a nil model'

Solution:

  • After upgrading to the latest MarketingCloudSDK, make sure to:
    1. Remove the existing MarketingCloudSDK.bundle from Xcode -> Build phases -> Copy Resources Bundle
    2. Add the latest MarketingCloudSDK.bundle as mentioned here: Migrating to SFMCSdk if SPM is used as dependency manager or follow #5 in Add the SDK for other methods.


Note: For every upgrade of the SDK, it is recommended to pull the MarketingCloudSDK.bundle each time as there may be upgrades to the bundle.