New MissingMethodExceptionon Mobile (Android)

Discussion and help for Easy Save 3
Post Reply
paulodaktor
Posts: 6
Joined: Mon Apr 19, 2021 11:28 pm

New MissingMethodExceptionon Mobile (Android)

Post by paulodaktor »

Hey,
I've updated Unity to LTS 2020.3.4f and apparently I can't load saved data anymore on my mobile device (android). I checked for a new version of ES3 and indeed there was 3.3.2f3 available. (I updated from LTS 2020.3.3f and ES3 3.3.2f1).
Sadly I did not particularly tested loading in a longer time, so maybe I already had this issue in other versions.
I'm using ES3 for a strategy game, where I save a lot of stuff at once (the error occures when I save a gameobject with childs, not with auto-save).

I added two Stack Traces (one from adb and one from Unity) , hopefully it helps you to better understand what the error is. When you need something else from me or already found a solution, please leave a comment :)

Unity Exceptions:

Code: Select all

System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) (at <00000000000000000000000000000000>:0)
System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) (at <00000000000000000000000000000000>:0)
System.Activator.CreateInstance (System.Type type, System.Object[] args) (at <00000000000000000000000000000000>:0)
ES3Internal.ES3Reflection.CreateInstance (System.Type type, System.Object[] args) (at <00000000000000000000000000000000>:0)
ES3Types.ES3StackType.Read (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] () (at <00000000000000000000000000000000>:0)
ES3Types.ES3UserType_Storage.ReadComponent[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ComponentType.ReadObject[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadComponents (ES3Reader reader, UnityEngine.GameObject go) (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Types.ES3CollectionType.ReadICollection[T] (ES3Reader reader, System.Collections.Generic.ICollection`1[T] collection, ES3Types.ES3Type elementType) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ArrayType.Read (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] () (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Types.ES3CollectionType.ReadICollection[T] (ES3Reader reader, System.Collections.Generic.ICollection`1[T] collection, ES3Types.ES3Type elementType) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ArrayType.Read (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] () (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Types.ES3CollectionType.ReadICollection[T] (ES3Reader reader, System.Collections.Generic.ICollection`1[T] collection, ES3Types.ES3Type elementType) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ArrayType.Read (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] () (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Types.ES3CollectionType.ReadICollection[T] (ES3Reader reader, System.Collections.Generic.ICollection`1[T] collection, ES3Types.ES3Type elementType) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ArrayType.Read (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] () (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.ReadInto[T] (ES3Reader reader, System.Object obj) (at <00000000000000000000000000000000>:0)
ES3Types.ES3Type_GameObject.ReadObject[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at <00000000000000000000000000000000>:0)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at <00000000000000000000000000000000>:0)
ES3.Deserialize (ES3Types.ES3Type type, System.Byte[] bytes, ES3Settings settings) (at <00000000000000000000000000000000>:0)
ES3.Deserialize[T] (System.Byte[] bytes, ES3Settings settings) (at <00000000000000000000000000000000>:0)
ES3File.Load[T] (System.String key, T defaultValue) (at <00000000000000000000000000000000>:0)
ES3.Load[T] (System.String key, T defaultValue, ES3Settings settings) (at <00000000000000000000000000000000>:0)
ES3.Load[T] (System.String key, System.String filePath, T defaultValue, ES3Settings settings) (at <00000000000000000000000000000000>:0)
GameManager+<LoadCycle>d__38.MoveNext () (at <00000000000000000000000000000000>:0)
MEC.Timing.Update () (at <00000000000000000000000000000000>:0)
UnityEngine.Debug:LogException(Exception)
MEC.Timing:Update()
adb:

Code: Select all

04-20 01:23:21.286  6658  6707 E Unity   : MissingMethodException: Constructor on type 'System.Collections.Generic.Stack`1[[Resource, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]' not found.
04-20 01:23:21.286  6658  6707 E Unity   :   at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
04-20 01:23:21.286  6658  6707 E Unity   :   at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <00000000000000000000000000000000>:0
04-20 01:23:21.286  6658  6707 E Unity   :   at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
04-20 01:23:21.286  6658  6707 E Unity   :   at ES3Internal.ES3Reflection.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <0000000000000
04-20 01:23:21.293  6658  6707 D Unity   : Uploading Crash Report
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: New MissingMethodExceptionon Mobile (Android)

Post by Joel »

Hi there,

Unfortunately I've not been able to replicate this at my end, and I've had no other reports of this. I suspect it's happening because the Stack constructor is being stripped.

Please could you replicate this in a new project and private message it to me?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: New MissingMethodExceptionon Mobile (Android)

Post by Joel »

Thanks for sending that over.

I removed Timing.cs from your project and got it to run synchronously, as I would otherwise need to learn how that works in order to isolate Easy Save as the issue.

However, I don't appear to have encountered any errors on device. Could you confirm that you're still getting the error with Timing.cs removed from your project?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
paulodaktor
Posts: 6
Joined: Mon Apr 19, 2021 11:28 pm

Re: New MissingMethodExceptionon Mobile (Android)

Post by paulodaktor »

Thanks for you help Joel, I removed Timing.cs and still managed to reproduce this issue in the test-project on my oneplus 3.
But apparently I've got it fixed in my original project by using an array insead of an stack.
After all I think I just misunderstood this advice: Image
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: New MissingMethodExceptionon Mobile (Android)

Post by Joel »

Hi there,

It looks like you've created an ES3Type for the ES3Type which handles Stacks (i.e. ES3StackType), rather than create an ES3Type for Stack (i.e. Stack<T>). However, there is a built-in ES3Type for Stack anyway, so this shouldn't be necessary.

If you'd rather use a Stack than an array and would like me to look into this further, please let me know. I'll need you to run some debug code at your end to try to understand what is happening.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply