0

I have an iOS app with several Core Data database versions. Currently, there seems to be an issue while migrating into the newest model. This is first time this happens. I'm using Magical Record to manage the Core Data database.

In order to start and migrate te database, I use the follow instruction in the AppDelegate: [MagicalRecord setupAutoMigratingCoreDataStack];

The error the simulator throws is the follow:

2015-06-17 11:34:51.715 Let's Talk[73667:4534853] CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/felipepenariveros/Library/Developer/CoreSimulator/Devices/B860A9AF-9AE5-4C92-861E-3065E68CA81F/data/Containers/Data/Application/599B6B79-71FE-451E-A742-6B0B409C6130/Library/Application%20Support/Let's%20Talk/Let's%20Talk.sqlite options:{
    NSInferMappingModelAutomaticallyOption = 1;
    NSMigratePersistentStoresAutomaticallyOption = 1;
    NSSQLitePragmasOption =     {
        "journal_mode" = WAL;
    };
} ... returned error Error Domain=NSCocoaErrorDomain Code=134130 "The operation couldn’t be completed. (Cocoa error 134130.)" UserInfo=0x7e6522e0 {URL=file:///Users/felipepenariveros/Library/Developer/CoreSimulator/Devices/B860A9AF-9AE5-4C92-861E-3065E68CA81F/data/Containers/Data/Application/599B6B79-71FE-451E-A742-6B0B409C6130/Library/Application%20Support/Let's%20Talk/Let's%20Talk.sqlite, metadata={
    NSPersistenceFrameworkVersion = 519;
    NSStoreModelVersionHashes =     {
        Avatar = <81f922ac d2ace942 6e317ec6 2c8ccefc ac9334c8 2f12b475 1bc17627 b5e0ea04>;
        Client = <8e78d409 efed05aa 8d17eba7 d01f00fb dad49764 14cf6b6c ee7e016e e3933f1c>;
        Conversation = <38aee26c ea7509df 1dee1ff2 b790407b 9900b492 513a854f 180b4042 eaaeb779>;
        Group = <f261f991 8319b8d7 e851c425 ac0d13b4 a78a9877 42c1b200 845d7984 e076ff00>;
        Inquiry = <abc5fd31 fe8c9b5b 758a563b cebd1c32 0f7889d8 63d082a3 21456a16 baba3100>;
        LTCategory = <540faefb 56fd40b0 6e78b2fb ed362b81 a545aba3 953fc737 bbc2c769 717a96b3>;
        Message = <8b25378a 5924640e e0c771fa f44a8ffb f858f7d8 02ea7687 a0ce764d 33feef29>;
        Organization = <d6e45f6e 1ee61e77 d024c717 b921a660 036532dc 3e6f6983 cddc5724 77f4f145>;
    };
    NSStoreModelVersionHashesVersion = 3;
    NSStoreModelVersionIdentifiers =     (
        ""
    );
    NSStoreType = SQLite;
    NSStoreUUID = "3AC4C906-9EB0-4534-A6EC-C02EB5F5DBBE";
    "_NSAutoVacuumLevel" = 2;
}, reason=Can't find model for source store} with userInfo dictionary {
    URL = "file:///Users/felipepenariveros/Library/Developer/CoreSimulator/Devices/B860A9AF-9AE5-4C92-861E-3065E68CA81F/data/Containers/Data/Application/599B6B79-71FE-451E-A742-6B0B409C6130/Library/Application%20Support/Let's%20Talk/Let's%20Talk.sqlite";
    metadata =     {
        NSPersistenceFrameworkVersion = 519;
        NSStoreModelVersionHashes =         {
            Avatar = <81f922ac d2ace942 6e317ec6 2c8ccefc ac9334c8 2f12b475 1bc17627 b5e0ea04>;
            Client = <8e78d409 efed05aa 8d17eba7 d01f00fb dad49764 14cf6b6c ee7e016e e3933f1c>;
            Conversation = <38aee26c ea7509df 1dee1ff2 b790407b 9900b492 513a854f 180b4042 eaaeb779>;
            Group = <f261f991 8319b8d7 e851c425 ac0d13b4 a78a9877 42c1b200 845d7984 e076ff00>;
            Inquiry = <abc5fd31 fe8c9b5b 758a563b cebd1c32 0f7889d8 63d082a3 21456a16 baba3100>;
            LTCategory = <540faefb 56fd40b0 6e78b2fb ed362b81 a545aba3 953fc737 bbc2c769 717a96b3>;
            Message = <8b25378a 5924640e e0c771fa f44a8ffb f858f7d8 02ea7687 a0ce764d 33feef29>;
            Organization = <d6e45f6e 1ee61e77 d024c717 b921a660 036532dc 3e6f6983 cddc5724 77f4f145>;
        };
        NSStoreModelVersionHashesVersion = 3;
        NSStoreModelVersionIdentifiers =         (
            ""
        );
        NSStoreType = SQLite;
        NSStoreUUID = "3AC4C906-9EB0-4534-A6EC-C02EB5F5DBBE";
        "_NSAutoVacuumLevel" = 2;
    };
    reason = "Can't find model for source store";
}

Any help would be appreciated.

richsage
  • 26,912
  • 8
  • 58
  • 65
Felipe Peña
  • 2,712
  • 4
  • 22
  • 41
  • What happens if you reset the simulator before running the app? Do you still get the error? – Rog Jun 18 '15 at 01:15
  • @Rog If I reset the simulator, the app gets deleted and I can't replicate the error. – Felipe Peña Jun 18 '15 at 01:27
  • I'm pretty sure this is a DEBUG only issue and it won't happen in a production environment (i.e. app store). See related answer http://stackoverflow.com/questions/3146515/iphone-core-data-lightweight-migration-cocoa-error-134130-cant-find-model-for – Rog Jun 18 '15 at 01:42
  • @Rog It happens with a Testflight build (using the new distribution method), installing the update above the App Store one. It seems currently this is pretty similar to production environment (Testflight build uses also the App Store provisioning profile). – Felipe Peña Jun 18 '15 at 02:18
  • What sort of changes have you made to the model? Perhaps Coredata has been unable to perform an auto migration for you and you will need to perform a custom migration. – Rog Jun 18 '15 at 03:02
  • @Rog Checked again, and I have only added new fields to model. There are no type or attribute name changes. – Felipe Peña Jun 18 '15 at 11:37

0 Answers0