Error in migration from v3 to v4 (Custom migration Policy)

I am getting this. Even though I can see where might be.
I am not able to fix it. I would need little help to get over this hump. I have tried, redoing everything and still running into this, Any help?

**CoreData: warning: no NSValueTransformer with class name 'ImageTransformer' was found for attribute 'image' on entity 'ImageAttachment'**

**2020-05-26 18:30:50.240603-0500 UnCloudNotes[4250:11852422] [error] error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/achoudhary/Library/Developer/CoreSimulator/Devices/AD161A8F-E227-4828-BD4B-FFCA8DAE84F6/data/Containers/Data/Application/69C4DB1C-D437-4DC9-BC54-9BCB31BF8F01/Library/Application%20Support/UnCloudNotesDataModel.sqlite options:{**

**NSInferMappingModelAutomaticallyOption = 0;**

**NSMigratePersistentStoresAutomaticallyOption = 1;**

**} ... returned error NSCocoaErrorDomain(134110) with userInfo dictionary {**

**NSUnderlyingException = "Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)";**

**}**

**CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/achoudhary/Library/Developer/CoreSimulator/Devices/AD161A8F-E227-4828-BD4B-FFCA8DAE84F6/data/Containers/Data/Application/69C4DB1C-D437-4DC9-BC54-9BCB31BF8F01/Library/Application%20Support/UnCloudNotesDataModel.sqlite options:{**

**NSInferMappingModelAutomaticallyOption = 0;**

**NSMigratePersistentStoresAutomaticallyOption = 1;**

**} ... returned error NSCocoaErrorDomain(134110) with userInfo dictionary {**

**NSUnderlyingException = "Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)";**

**}**

**CoreData: annotation: <NSPersistentStoreCoordinator: 0x600000844d00>: Attempting recovery from error encountered during addPersistentStore: Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration." UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)}**

**Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration." UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)}: file /Users/achoudhary/Documents/edu.self/RW/Core_Data_by_Tutorials_v6.0.0/06-versioning-and-migration/starter/UnCloudNotes/CoreDataStack.swift, line 81**

**2020-05-26 18:30:50.244532-0500 UnCloudNotes[4250:11852422] Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration." UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)}: file /Users/achoudhary/Documents/edu.self/RW/Core_Data_by_Tutorials_v6.0.0/06-versioning-and-migration/starter/UnCloudNotes/CoreDataStack.swift, line 81**

@alokc83 Please check out the updated version of the book:

https://store.raywenderlich.com/products/core-data-by-tutorials

I hope it helps!

This topic was automatically closed after 166 days. New replies are no longer allowed.