Hello!
I can create a connection to my realtime server uses lambda calls when I build a Unity project that uses Mono as its scripting backend, but when I build via IL2CPP, which I need to if I want to build with Universal Windows Platform (VR use), my code no longer works. I can even get this code to work from a UWP platform if I only run it from the Unity Editor. All of that to me suggests it has to do solely with it being an IL2CPP build.
My code:
InvokeResponse invokeResponse = null;
try
{
invokeResponse = await _client.InvokeAsync(_request);
}
catch (Exception _exception)
{
Debug.LogError("INSIDE CATCH: " + invokeResponse?.FunctionError + _exception);
GetInstance().QForMainThread(AddErrorText, invokeResponse?.FunctionError + _exception.ToString());
}
The try always fails with IL2CPP with the error:
System.Net.Http.HttpRequestException: An error occurred while sending the request —> System.Net.WebException: Error: ConnectFailure (Value does not fall within the expected range.) —> System.ArgumentException: Value does not fall within the expected range.
Full Stack Trace is too large to enter in, so it is attached as a .txt file.
FullStackTrace.txt (588.3 KB)
I do have a link.xml file in my Assets folder and it is set up as follows:
<linker>
<!-- if you are using AWSConfigs.HttpClient.UnityWebRequest option-->
<assembly fullname="UnityEngine">
<type fullname="UnityEngine.Networking.UnityWebRequest" preserve="all" />
<type fullname="UnityEngine.Networking.UploadHandlerRaw" preserve="all" />
<type fullname="UnityEngine.Networking.UploadHandler" preserve="all" />
<type fullname="UnityEngine.Networking.DownloadHandler" preserve="all" />
<type fullname="UnityEngine.Networking.DownloadHandlerBuffer" preserve="all" />
</assembly>
<assembly fullname="mscorlib">
<namespace fullname="System.Security.Cryptography" preserve="all"/>
</assembly>
<assembly fullname="System">
<namespace fullname="System.Security.Cryptography" preserve="all"/>
</assembly>
<assembly fullname="AWSSDK.Core" preserve="all">
<namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
</assembly>
<assembly fullname="AWSSDK.CognitoIdentity" preserve="all"/>
<assembly fullname="AWSSDK.SecurityToken" preserve="all"/>
<assembly fullname="AWSSDK.Lambda" preserve="all"/>
</linker>
Any help with this error would be greatly appreciated! Let me know if you need more information to help track down what’s going on.