Link under https://github.com/aws/aws-sdk-net/#unity-support is broken.
Unity.README.md disappeared in this commit https://github.com/aws/aws-sdk-net/commit/8473adaa6c78e598a9a14ec103c1fb8587dc8998. However, the AWS SDK for Unity is deprecated and projects using Unity 2018.1 or later should use the .NET Standard 2.0 release of the AWS SDK for .NET. The deprecated library can be found here: https://github.com/aws/aws-sdk-unity-net, and has limited features.
I would suggest that the README.md be updated to reflect the information found in this blog post https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/ which details where to find the prebuilt binaries and how to get Unity working correctly with the AWS .NET SDK when il2cpp is used. Also, have a link to the deprecated repository for people using older versions of Unity.
What IS the right way to get up and running now? Even with the .NET Standard 2.0 release, the sample S3 code doesn't compile.
After following the recommendation linked by @squidbot above, I'm getting an error
Assembly 'Assets/OurAssets/AWS/AWSSDK.Core.dll' will not be loaded due to errors:
Unable to resolve reference 'Microsoft.Bcl.AsyncInterfaces'. Is the assembly missing or incompatible with the current platform?
I copied the AWSSDK.Lambda and AWSSDK.Core dlls into the project and updated link.xml accordingly. Is there a place I can find Microsoft.Bcl.AsyncInterfaces?
As it happens I'm writing up a new guide that includes these details. Here's my notes on integrating the AWS .Net SDK in to Unity. These are just notes, so it may be a little disorganized, but it should get you on the right track. In this case, I'm just adding AWSSDK.Core and AWSSDK.CognitoIdentityProvider. I do have this up and running in Unity 2020.1.3f1. The blog post I refer to is https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/
[Begin Notes]
Downloaded SDK from http://sdk-for-net.amazonwebservices.com/latest/v3/aws-sdk-netstandard2.0.zip
Created Plugins folder in Assets
Selected .NET Standard 2.0 in the Project... Player settings
In my case, I’m not going to build with IL2CPP, but if I did you need to use the xml file from the blog post to prevent the assemblies from getting stripped you can include that
Added to the new plugins folder
You’ll see errors about the assemblies not loading due to a missing reference to Microsoft.Bcl.AsyncInterfaces. You need to get these from NuGet. This page https://docs.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017#add-packages-from-nuget-to-a-unity-project discusses how to add the dll’s from NuGet correctly. I made this a little easier... problem is the VisualStudio project is constantly resaved, so you lose any nuget stuff you set up in the project, so you need to grab from nuget and then copy to the plugins folder.
At this point all dependencies should be resolved. Note there are some easier ways to use NuGet with Unity, including a package here that looks pretty sweet but I didn’t try it: https://github.com/GlitchEnzo/NuGetForUnity
Once you’ve moved over the dll’s you can delete the packages folder to clean things up.
Thank you! I almost got there myself, thank you for filling in the gaps.
As it happens I'm writing up a new guide that includes these details. Here's my notes on integrating the AWS .Net SDK in to Unity. These are just notes, so it may be a little disorganized, but it should get you on the right track. In this case, I'm just adding AWSSDK.Core and AWSSDK.CognitoIdentityProvider. I do have this up and running in Unity 2020.1.3f1. The blog post I refer to is https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/
[Begin Notes]
Downloaded SDK from http://sdk-for-net.amazonwebservices.com/latest/v3/aws-sdk-netstandard2.0.zip
Created Plugins folder in Assets
Selected .NET Standard 2.0 in the Project... Player settings
In my case, I’m not going to build with IL2CPP, but if I did you need to use the xml file from the blog post to prevent the assemblies from getting stripped you can include that
Added to the new plugins folder
- AWSSDK.Core.dll
- AWSSDK.CognitoIdentiyProvider.dll
You’ll see errors about the assemblies not loading due to a missing reference to Microsoft.Bcl.AsyncInterfaces. You need to get these from NuGet. This page https://docs.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017#add-packages-from-nuget-to-a-unity-project discusses how to add the dll’s from NuGet correctly. I made this a little easier... problem is the VisualStudio project is constantly resaved, so you lose any nuget stuff you set up in the project, so you need to grab from nuget and then copy to the plugins folder.
- In Visual Studio, right click the solution, go to “Manage NuGet Pacakges for Solution...”
- Click the Browse tab in the NuGet tool
- Search for Microsoft.Bcl.AsyncInterfaces, click on it
- Select Project then Install
- In file explorer, navigate to your project and find the Packages folder
3 packages were installed
- Microsoft.Bcl.AsyncInterfaces.dll
- System.Runtime.CompilerServices.Unsafe.dll
- System.Threading.Tasks.Extensions.dll
- Dive in to each package, look for lib/netstandard2.0 and copy the dll from there by dragging it in to the Unity editor in plugins
At this point all dependencies should be resolved. Note there are some easier ways to use NuGet with Unity, including a package here that looks pretty sweet but I didn’t try it: https://github.com/GlitchEnzo/NuGetForUnity
Once you’ve moved over the dll’s you can delete the packages folder to clean things up.
THANKS, THANKS, THANK YOU VERY MUCH.
I've been dealing with this references issue for a couple of days. I was able to make them work following this workaround. Really appreciated.
For other users, I wasn't able to de-zip the nugget packages for some reason. What I did was in my unity solution in rider IDE, I installed the packages from Nuget (Tools > Nuget > Show Nuget Tool Window). I installed them. They go into UnityProjectRoot/Packages folder.
This doesn't actually work, but it gives you access to the appropriate DLLs. You go into the folders in finder and look for the dotnetstandard2.0 versions of the dlls, and drag these into the plugins folder.
Then you delete the folders that were added into the packages folder. Be careful not to delete the package lock or manifest file!
Note: I got an error that I already had System.Runtime.CompilerServices.Unsafe.dll. So I just deleted it afterwards.
The README for aws/aws-sdk-net has been updated to handle changes to Unity support.
The following is a direct link to the Unity content in the README: https://github.com/aws/aws-sdk-net#unity-support
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Most helpful comment
As it happens I'm writing up a new guide that includes these details. Here's my notes on integrating the AWS .Net SDK in to Unity. These are just notes, so it may be a little disorganized, but it should get you on the right track. In this case, I'm just adding AWSSDK.Core and AWSSDK.CognitoIdentityProvider. I do have this up and running in Unity 2020.1.3f1. The blog post I refer to is https://aws.amazon.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp/
[Begin Notes]
Downloaded SDK from http://sdk-for-net.amazonwebservices.com/latest/v3/aws-sdk-netstandard2.0.zip
Created Plugins folder in Assets
Selected .NET Standard 2.0 in the Project... Player settings
In my case, I’m not going to build with IL2CPP, but if I did you need to use the xml file from the blog post to prevent the assemblies from getting stripped you can include that
Added to the new plugins folder
You’ll see errors about the assemblies not loading due to a missing reference to Microsoft.Bcl.AsyncInterfaces. You need to get these from NuGet. This page https://docs.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017#add-packages-from-nuget-to-a-unity-project discusses how to add the dll’s from NuGet correctly. I made this a little easier... problem is the VisualStudio project is constantly resaved, so you lose any nuget stuff you set up in the project, so you need to grab from nuget and then copy to the plugins folder.
At this point all dependencies should be resolved. Note there are some easier ways to use NuGet with Unity, including a package here that looks pretty sweet but I didn’t try it: https://github.com/GlitchEnzo/NuGetForUnity
Once you’ve moved over the dll’s you can delete the packages folder to clean things up.