Saving fails when using Assembly Definitions
Posted: Wed Jul 22, 2020 3:08 pm
Hello! I added assembly definitions to my proyect so I could use unit testing. I'm working on a WebGL proyect so the games can be played on web and mobile using ionic. On web, PC, editor and even APK file it all works great, but on the WebGL build for mobile (using gzip) the error:
NullReferenceException: Object reference not set to an instance of an object.
at ES3Writer.Merge(ES3Reader reader) [0x000000]
at ES3Writer.Merge() [0x000000]
at ES3Writer.Save(System.Boolean overwriteKeys) [0x000000]
at ES3Writer.Save() [0x000000]
at ES3.Save[T] (System.String key, T value, ES3Settings settings) [0x000000]
at ES3.Save[t] (System.String key, T value) [0x000000]
The line of code is:
The variables used on the line are not null. Doing a Debug.Log of them displays the correct info we want to save.
And doing
will always load the fallback option (not sure if its related or if it's because there is actually no info and it can't be saved anyways)
The thing that bothers me the most is that it works perfectly on PC, Web browser and APK file. But it didn't happen before, just after adding the Assembly Definitions and building for WebGL to use on an Ionic build.
The Unity version i'm using is: 2019.3.7f1
NullReferenceException: Object reference not set to an instance of an object.
at ES3Writer.Merge(ES3Reader reader) [0x000000]
at ES3Writer.Merge() [0x000000]
at ES3Writer.Save(System.Boolean overwriteKeys) [0x000000]
at ES3Writer.Save() [0x000000]
at ES3.Save[T] (System.String key, T value, ES3Settings settings) [0x000000]
at ES3.Save[t] (System.String key, T value) [0x000000]
The line of code is:
Code: Select all
ES3.Save (currentUserId + globalInstance.name + "Levels", myLevels);
And doing
Code: Select all
ES3.Load (currentUserId + globalInstance.name + "Progress", -6));
The thing that bothers me the most is that it works perfectly on PC, Web browser and APK file. But it didn't happen before, just after adding the Assembly Definitions and building for WebGL to use on an Ionic build.
The Unity version i'm using is: 2019.3.7f1