Hi all, so far my gamelift test goes well in Unity 2019.2.0f1
But as long as I change the scripting backend from “Mono” to “IL2CPP”
It gives me some exception info when I run “GameLiftServerAPI.InitSDK”
Anyone can give me some insights on this issue?
Here’s the log:
WindowsPlayer ArgumentOutOfRangeException: Parameter: defaultRepositoryType, Value: [log4net.Repository.Hierarchy.Hierarchy] out of range. Argument must implement the ILoggerRepository interface
Parameter name: defaultRepositoryType
Actual value was log4net.Repository.Hierarchy.Hierarchy.
at log4net.Core.DefaultRepositorySelector…ctor (System.Type defaultRepositoryType) [0x00000] in <00000000000000000000000000000000>:0
at log4net.Core.LoggerManager…cctor () [0x00000] in <00000000000000000000000000000000>:0
at log4net.LogManager.GetLogger (System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at Aws.GameLift.Server.ServerState…cctor () [0x00000] in <00000000000000000000000000000000>:0
at Aws.GameLift.Server.GameLiftServerAPI.InitSDK () [0x00000] in <00000000000000000000000000000000>:0
I would suspect this is because of the differences between how I2LCPP build things.
I believe the IL2CPP build toolchain does some form of managed code stripping of assemblies, removing managed code from that that is not called at runtime. The Mono build toolchain does not do this by default, or at least that used to be the case.
The main reason why we want IL2CPP is to improve the performance in general. So I followed the document and the original issue is gone. However, I got some other issues. It seems that some 3rd-party libs like “JsonDotNet” and “protobuf-net” are not really AOT friendly.