Realm Android: Destructive schema update is not working in current device even after app uinstallation, works in new installation

I’m working on development mode on Android and have changed the following schema on Atlas UI as well as in Android model schema. I know it’s a destructive schema and it’s intentional, since I’m working development. I got following error:

Exception has been thrown: The following changes cannot be made in additive-only schema mode:
- Property 'Customer.updated' has been changed from 'string' to 'date'.

I have tried following, still not working:

  1. Terminated Sync and Enable sync
  2. Disabled Development Mode
  3. Uninstalled App and Reinstalled app
  4. Tried adding following default client Reset logic from doc:
app = new App(new AppConfiguration.Builder(appID)
                .defaultSyncClientResetStrategy(new DiscardUnsyncedChangesStrategy() {
                    @Override
                    public void onBeforeReset(Realm realm) {
                        Log.w("EXAMPLE", "Beginning client reset for " + realm.getPath());
                    }
                    @Override
                    public void onAfterReset(Realm before, Realm after) {
                        Log.w("EXAMPLE", "Finished client reset for " + before.getPath());
                    }
                    @Override
                    public void onError(SyncSession session, ClientResetRequiredError error) {
                        Log.e("EXAMPLE", "Couldn't handle the client reset automatically." + " Falling back to manual recovery: " + error.getErrorMessage());
                        //handleManualReset(session.getUser().getApp(), session, error);
                    }

                    @Override
                    public void onManualResetFallback(SyncSession session, ClientResetRequiredError error) {
                        Log.e("EXAMPLE", "onManualResetFallback : " + error.getErrorMessage());

                    }
                })
                .build());

Still not working. Same error.

One strange thing is, when I install the app on another device, it’s working fine. But unistall/install on my device doesn’t work.

Hi,

The client and the server schema differ for the updated field. From the UI, you can navigate to Schema on the sidebar then select your Customer collection and update the type of the updated field to be a date type. Then terminate and restart sync.

When you restart the app the client schema should match the server side schema and it should connect successfully.

Please let me know if that doesn’t work.

See these docs for some further info around breaking changes

Best of luck,
Yaseen

Hi,

As written in the post, I have :

have changed the following schema on Atlas UI as well as in Android model schema

  1. Terminated Sync and Enable sync

Still not worked.

Hi,

Apologies that it didn’t help. I may need some more info in order to help you correctly diagnose the issue, could you please direct message me your app id?

Click on my profile and press Message.

Is it failing with this exact same error message after updating the schemas?

 The following changes cannot be made in additive-only schema mode:
- Property 'Customer.updated' has been changed from 'string' to 'date'

Thanks