Strange Behaviour - Unity Realm SDK

There seems to be strange behaviour when I run my app in the editor. The first time I run it, it’s fine. The second time I run it, it crashes the unity application. Here is a sample of my code:

var app = App.Create(realmAppId);
var credentials = Credentials.ApiKey(apiKey);
var user = await app.LogInAsync(credentials);

        client = user.GetMongoClient(mongoClient);
        database = client.GetDatabase(databaseName);
catch(Exception e){ }

I am wondering if I have to handle dispose or close the connection? I am unsure.

Thank you,

Hey, the current public version of the Unity SDK is a very early preview where only the local database was tested and verified to be working. We have identified and resolved a number of issues related to the sync/remote MongoDB part of the SDK and hope to release those next week.

Nice! thanks for responding.

@theresaj We’d love to hear more about the game you are looking to build with the Realm Unity SDK - drop me a line at and I can let you fill you in on our gaming roadmap for Realm

1 Like