Troubleshooting MarketingCloudSDK.bundle inclusion Crash
The below troubleshooting guide is applicable until MarketingCloudSDK version 8.0.13. Post this version, manual addition of bundle to the application is removed and is automated.
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
+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'SFMCEndpointConfigurationEntity'
'NSFetchRequest could not locate an NSEntityDescription for entity name 'SFMCEventConfigurationEntity''
'Cannot create an NSPersistentStoreCoordinator with a nil model'
Solution:
- After upgrading to the latest MarketingCloudSDK, make sure to:
- Remove the existing MarketingCloudSDK.bundle from
Xcode -> Build phases -> Copy Resources Bundle
- 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.
- Remove the existing MarketingCloudSDK.bundle from
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.