You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using FullSerializer on AOT platforms with the newest runtime & compatibility level, serialization/deserialization should complete successfully.
Current Behavior
With the newest runtime (.NET 4.X) with compatibility level .NET 4.X, serialization fails on AOT platforms (Android tested in my case).
I have traced the offending line down to "return ((PropertyInfo)_memberInfo).GetValue(context, new object[] { });" in fsMetaProperty.Read(object context)
Possible Solution
I worked around this issue for myself by changing the line return ((PropertyInfo)_memberInfo).GetValue(context, new object[] { });
to return ((PropertyInfo)_memberInfo).GetGetMethod().Invoke(context, null);
While this seems to resolve the issues, it causes the runtime tests to fail due to exceptions being thrown on that line. Due to this, I am currently using .NET Standard 2.0 without my work-around for now. (It may be possible to implement the hotfix in a compatible way by doing some kind of null-check prior)
Build the FullSerializer.Testing.test_scene.unity with configuration specified in Context(Environment)
Watch it fail serialization
Context (Environment)
As Unity 2018 introduces many workflow improvements for us, I have upgraded our project to use it. I was experimenting with using the .NET 4.X compatibility level, but after hitting these issues I have decided to stay with .NET Standard 2.0 for now.
Unity Version: Unity 2018.1.6f1 FullSerializer Version (Latest commit):c01db30 Unity Target: Android 6.0, Huawei Mediapad T3 Scripting Runtime Version: .NET 4.x Equivalent Scripting Backend: IL2CPP Api Compatibility Level: .NET 4.x
The text was updated successfully, but these errors were encountered:
Expected Behavior
When using FullSerializer on AOT platforms with the newest runtime & compatibility level, serialization/deserialization should complete successfully.
Current Behavior
With the newest runtime (.NET 4.X) with compatibility level .NET 4.X, serialization fails on AOT platforms (Android tested in my case).
I have traced the offending line down to "return ((PropertyInfo)_memberInfo).GetValue(context, new object[] { });" in fsMetaProperty.Read(object context)
Possible Solution
I worked around this issue for myself by changing the line
return ((PropertyInfo)_memberInfo).GetValue(context, new object[] { });
to
return ((PropertyInfo)_memberInfo).GetGetMethod().Invoke(context, null);
While this seems to resolve the issues, it causes the runtime tests to fail due to exceptions being thrown on that line. Due to this, I am currently using .NET Standard 2.0 without my work-around for now. (It may be possible to implement the hotfix in a compatible way by doing some kind of null-check prior)
Solution reference here:
https://forum.unity.com/threads/unity-5-0-3f2-il2cpp-problem-attempting-to-call-method-system-reflection-monoproperty-getteradapt.332335/page-2
Steps to Reproduce
Context (Environment)
As Unity 2018 introduces many workflow improvements for us, I have upgraded our project to use it. I was experimenting with using the .NET 4.X compatibility level, but after hitting these issues I have decided to stay with .NET Standard 2.0 for now.
Unity Version: Unity 2018.1.6f1
FullSerializer Version (Latest commit): c01db30
Unity Target: Android 6.0, Huawei Mediapad T3
Scripting Runtime Version: .NET 4.x Equivalent
Scripting Backend: IL2CPP
Api Compatibility Level: .NET 4.x
The text was updated successfully, but these errors were encountered: