My project has added widget. Without the need to open the app, the data needs to be updated synchronously when the widget is updated, so I created a synchronizer in both the app and the widget, or created a synchronizer in a singleton class to give app and widget use. However, after the widget is synchronized, opening the app and synchronizing the realm in the app will report the following error:
*** Terminating app due to uncaught exception 'RLMException', reason: 'Attempting to create an object of type 'GroupMessage' with an existing primary key value 'D2CB7AB4-D505-4568-83D1-CBA8EB28408B'.'
My project has added widget. Without the need to open the app, the data needs to be updated synchronously when the widget is updated, so I created a synchronizer in both the app and the widget, or created a synchronizer in a singleton class to give app and widget use. However, after the widget is synchronized, opening the app and synchronizing the realm in the app will report the following error:
*** Terminating app due to uncaught exception 'RLMException', reason: 'Attempting to create an object of type 'GroupMessage' with an existing primary key value 'D2CB7AB4-D505-4568-83D1-CBA8EB28408B'.'