Open EdevJogos opened 2 years ago
Hello, I tried to reproduce your issue, but I did not encounter it when I tried. I did log my repro steps (shown at the end of this post). I don't know if you tried to build the project with the included build script. This automatically does some required steps, like downloading and building the GameLift SDK which is then put into the Assets\Plugins directory for use by Unity, and it also does a Unity build for both the game server and the game client. You are using a much newer version of Unity than the sample (or GameLift SDK) was created with, and Unity keeps making breaking changes, so keeping up with that can be a problem. I will list the steps you probably need to take, but include the steps I took for my own successful build as additional reference.
BUILDING Server The system cannot find the path specified. USING "C:\Program Files\Unity\2021.1.26f1\Editor\Unity.exe" TO BUILD BUILD COMPLETED SUCCESSFULLY. SEE C:\Users\alanmur\AppData\Local\Unity\Editor\Editor.log
BUILDING Client The system cannot find the path specified. USING "C:\Program Files\Unity\2021.1.26f1\Editor\Unity.exe" TO BUILD BUILD COMPLETED SUCCESSFULLY. SEE C:\Users\alanmur\AppData\Local\Unity\Editor\Editor.log
IF you get the same error as I do in my STEP 11 below, then take the same steps (exactly) to remediate.
Then follow the rest of the instructions in the readme to deploy the server and connect using the client.
For additional reference, here are the steps that I took.
GOOD LUCK! Let me know if that helps, or if I can assist further.
I downloaded the same version of Unity as you are using.
I restarted the computer after Visual Studio 2019 Community had installed.
I cloned the repository into a directory on my computer.
I ran the Build\build.bat file in the terminal. This downloaded the GameLift Server SDK 4.0.0. This project targets .NET Framework 4.5, which is no longer supported with a Dev Pack.
I opened the following file in the Visual Studio 2019 that was installed. aws-samples\amazon-gamelift-unity\SDK\GameLift_04_16_2020\GameLift-SDK-Release-4.0.0\GameLift-CSharp-ServerSDK-4.0.0\GameLiftServerSDKNet45.sln
I chose to retarget the project to .NET 4.6.1. Visual Studio asked me to install the .NET for Desktop Visual Studio workload. (Weirdly enough this installed the .NET 4.5 targeting pack).
I built the GameLift SDK in Visual Studio 2019 to validate that we are successful.
I retargeted the GameLift SDK project BACK to 4.5, and it built now. You must already have got this far.
I went back to the command line and ran the Build\build.bat file.
buildconfig.bat couldn't find Unity. I manually set the file in buildconfig.bat by addiong this at line 86:
IF EXIST "%ProgramFiles%\Unity\2021.1.26f1\Editor\Unity.exe" SET UNITYEXE="%ProgramFiles%\Unity\2021.1.26f1\Editor\Unity.exe"
I went back to the command line and ran the Build\build.bat file. I got this error in the Editor.log.
Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. (C:/aws-samples/amazon-gamelift-unity/Library/PackageCache/com.unity.nuget.newtonsoft-json@2.0.0/Runtime/Newtonsoft.Json.dll) Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Assets/Plugins/Newtonsoft.Json.dll) Scripts have compiler errors.
To fix that, I went into aws-samples\amazon-gamelift-unity\Assets\Plugins and deleted the Newtonsoft.Json.dll.meta and Newtonsoft.Json.dll files.
From the command line at aws-samples\amazon-gamelift-unity\Build I used buildconfig.bat Server to build the server (success). Capitalized S in Server is required!
From the command line at aws-samples\amazon-gamelift-unity\Build I used buildconfig.bat Client to build the client (success). Capitalized C in Client is required.
The project build is complete now and you can deploy the server with the deploy.bat script according to the instructions in the readme.
Hi, thanks for the detailed guide, i'll try it out.
Failed to Build it seems like (System.Memory.dll not allowed to be included or could not be found)
ArgumentException: The Assembly System.Runtime.CompilerServices.Unsafe is referenced by System.Memory ('Assets/Plugins/System.Memory.dll'). But the dll is not allowed to be included or could not be found. Extracting referenced dlls failed. Building Player failed Component GUI Layer in Main Camera for Scene Assets/Scene/scene.unity is no longer available. It will be removed after you edit this GameObject and save the Scene. Failed to build player. Exiting without the bug reporter. Application will terminate with return code 1
Full Editor.log: Editor.log