-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoke Lambda function failed with Unity 2017.1.0f3 #696
Comments
Related thread on Unity Forum:
@nzmkey Possible Solution worked just fine for my DynamoDB calls, thank you for reporting and providing a solution. |
How can I use AWS API Gateway with latest Unity version? Since headers cannot be modified, I cannot use WWW class. IT fails because I'm trying to add the headers such as "X-Amz-Security-Token", "X-Amz-Content-SHA256", "Authorization", etc.. |
Possible Solution*** Not a solution but a workaround mention in #643 Amazon.AWSConfigs.HttpClient = Amazon.AWSConfigs.HttpClientOption.UnityWebRequest; I am not sure how to apply this fix exactly. My code......
} private DynamoDBContext Context
public void GetCognitoPoolRegion() public void ConfirmAmazonCredentials()
Just like others, everything worked perfectly fine before the 2017 update... I tried adding "Amazon.AWSConfigs.HttpClient = Amazon.AWSConfigs.HttpClientOption.UnityWebRequest;" to several different places throughout the code but haven't found the right spot yet. |
The #643 workaround doesn't appear to work in 2017.2 or 2017.1.1p3. The problematic header is
https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.SetRequestHeader.html I'll have to figure out how to build the dlls to test a fix but the solution should be straight-forward (remove |
Is it safe to say that the AWS SDK is not working outside of unity 5.6.x+? |
Still no update on this? Unity is on 2017.2 now, been out for a while. Why is SDK still broken? |
Any input from the dev team would be a nice addition. My projects are stuck at 5.6 because the framework simply dropped support for unity. |
I used the workaround for a Windows build and it appeared to work with Unity 2017.2.0f3 in editor and with compiled Windows x64 build. I cannot confirm for other build types. Still disappointing no official fix. |
I implemented a hack/workaround that seems pretty solid by intercepting the request that gets queued into the UnityRequestQueue. Requests get processed in the Update method in UnityMainThreadDispatcher. If you have a MonoBehaviour that sits above UnityRequestQueue happens to be a singleton so with some reflection, you can get a reference to the private requests Queue and then use Obviously going the route of using reflection to get at a private property is not good practice but I need it to work now... ¯\_(ツ)_/¯ |
Here's a temporary fix for Unity 2017.1 versions. Presumably, this should also work in Unity 2017.2 versions if you have the same bug, but I haven't tested. As mentioned above, all you need is to manually override the target // UnityMainThreadDispatcher.cs
public void Awake()
{
_logger = Logger.GetLogger(this.GetType());
// Call the method to process requests at a regular interval.
_nextUpdateTime = Time.unscaledTime;
_nextUpdateTime += _updateInterval;
// Override HttpClient here
Amazon.AWSConfigs.HttpClient = Amazon.AWSConfigs.HttpClientOption.UnityWebRequest;
} Simply override the HttpClient in the Update |
Hi @chenchen2015 - Could you please supply your dll with this fix? |
@dave-colenso I have updated my answer to include the compiled assemblies. Hope it helps! |
@chenchen2015 Is there a step by step on how to Compile the DLL assemblies to solve this issue (I tried using your dlls but it's not the same version as the latest version)?
Thank you!
|
@mgrogin I think you might be missing the reference of The dll file should be located at Hope this helps. |
Thanks for your answer @chenchen2015. I wonder if it has something to do with the fact that I have Unity 2017 installed and not 5 There are no warning signs on the refferences Thanks. |
Possible Solution Amazon.AWSConfigs.HttpClient = Amazon.AWSConfigs.HttpClientOption.UnityWebRequest; Work fine !! |
We have noticed this issue has not recieved attention in a year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
After upgrade to Unity 2017.1.0, all Lambda function failed to invoke.
The LambdaExample provided with the plugin aws-sdk-unity_3.3.121.0 also failed.
Expected Behavior
Call function via InvokeAsync should work without exception
Current Behavior
With the LambdaExample, clicking the Invoke button cause an exception:
Possible Solution
Not a solution but a workaround mention in #643
Add below after UnityInitializer is attached to gameobject
Steps to Reproduce (for bugs)
Requirement:
Unity 2017.1.0f3
aws-sdk-unity_3.3.121.0
Setup LambdaExample provided in the plugin (Setup Cognito and Region)
Run scene
Enter function name and press the invoke button
Your Environment
Unity 2017.1.0f3
aws-sdk-unity_3.3.121.0
Windows 10
The text was updated successfully, but these errors were encountered: