Unity-Technologies / FPSSample

A first person multiplayer shooter example project in Unity
https://unity.com/fps-sample
Other
4.87k stars 1.84k forks source link

NullReferenceException at startup #99

Open ghost opened 4 years ago

ghost commented 4 years ago
0: Build type: release
0: BuildID: AutoBuild
0: Cwd: C:\Users\shpark\src\FPSSample\AutoBuild
0: SimpleBundleManager initialized
0: LevelManager initialized
0: InputSystem initialized
0: Loaded game config
ProcessCommandLineArguments: C:\Users\shpark\src\FPSSample\AutoBuild\AutoBuild.exe +serve Level_01 -batchmode -nographics
0: cmd: serve Level_01
>exec -s user.cfg
>exec -s boot.cfg
>serve Level_01
1: Game loop ServerGameLoop requested
2: Switching state: null -> Idle
2: Listening on 147.46.174.203 on port 7913
2: SQP Initialized. Listening on port 7923
2: GameWorld ServerWorld initializing
2: Network server initialized
Cannot add command load twice
2: loading:AssetBundles/Level_01
2: [ERR] Unable to open archive file: AssetBundles/Level_01
2: ERROR : Cannot load level : Level_01
2: Server initialized
2: EXCEPTION Object reference not set to an instance of an object
  at ServerGameLoop.UpdateNetwork () [0x000be] in <a7cc5756c5d340c4af4274779856bd24>:0
  at ServerGameLoop.Update () [0x000d1] in <a7cc5756c5d340c4af4274779856bd24>:0
  at Game.Update () [0x0021e] in <a7cc5756c5d340c4af4274779856bd24>:0
2: NullReferenceException: Object reference not set to an instance of an object

After building game using FPSSample > Windows > Project Tools > Build game > Start, I got an NullReferenceException.

Could you give me some idea for troubleshooting?

ghost commented 4 years ago

Is this related to this link errors at build time?


System.InvalidOperationException: The linker failed. Check previous exception in the log
   at Burst.Compiler.IL.Aot.AotCompiler.CallLinkerProcess(TargetPlatform platform, TargetCpu targetCpu, List`1 plugins, List`1 inputFiles, String outputFile)
   at Burst.Compiler.IL.Aot.AotCompiler.Link(Module module, AotCompilerOptions compilerOptions)
   at Burst.Bcl.Program.Main(String[] args)

Failed running C:\Users\shpark\src\FPSSample\Library\PackageCache\com.unity.burst@0.2.4-preview.45\.Runtime\bcl.exe --debug=true @C:\Users\shpark\AppData\Local\Temp\tmp1e01132d.tmp

stdout:
Compiling for the platform `Windows` using the following toolchain : MsvcDesktopToolChain
    Msvc Install Version: 15.0
    Msvc Install SDK Directory: C:\Program Files (x86)\Windows Kits\10
    Msvc Linker Path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\link.exe
    Msvc Compiler Path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe

System.Exception: Process C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\link.exe ended with exitcode 1181
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'

   at Unity.IL2CPP.Shell.ExecuteAndCaptureOutput(ExecuteArgs executeArgs)
   at Burst.Compiler.IL.Aot.AotLinker.Link(IEnumerable`1 objFiles, String outPath)
   at Burst.Linker.Program.Main(String[] args)
Usage: blink.exe [options] <input .o/.obj/.ll files...>
      --help                 Show Help
      --platform=VALUE       Target Platform <Windows|macOS|Linux|Android|iOS|
                               PS4|XboxOne|Wasm|UWP>
      --target=VALUE         Target CPU <Auto|X86_SSE2|X86_SSE4|X64_SSE2|X64_
                               SSE4|AVX|AVX2|AVX512|WASM32|ARMV7A_NEON32|ARMV8A_
                               AARCH64|THUMB2_NEON32>
      --il2cpp-plugin-folder=VALUE
                             Plugin folder
      --output=VALUE         Output shared library file

An unexpected exception occurred: 
stderr:

System.InvalidOperationException: The linker failed. Check previous exception in the log
   at Burst.Compiler.IL.Aot.AotCompiler.CallLinkerProcess(TargetPlatform platform, TargetCpu targetCpu, List`1 plugins, List`1 inputFiles, String outputFile)
   at Burst.Compiler.IL.Aot.AotCompiler.Link(Module module, AotCompilerOptions compilerOptions)
   at Burst.Bcl.Program.Main(String[] args)

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLs(BuildReport) (at Library/PackageCache/com.unity.burst@0.2.4-preview.45/Editor/BurstAotCompiler.cs:247)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

System.Exception: C:\Users\shpark\src\FPSSample\Library\PackageCache\com.unity.burst@0.2.4-preview.45\.Runtime\bcl.exe did not run properly!
  at UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) [0x0011f] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildUtils.cs:130 
  at UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) [0x00063] in C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildUtils.cs:73 
  at Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) [0x005d5] in C:\Users\shpark\src\FPSSample\Library\PackageCache\com.unity.burst@0.2.4-preview.45\Editor\BurstAotCompiler.cs:247 
UnityEngine.Debug:LogError(Object)
Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLs(BuildReport) (at Library/PackageCache/com.unity.burst@0.2.4-preview.45/Editor/BurstAotCompiler.cs:251)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
NathanDalessio commented 4 years ago

In the project tools window click Open build files and check that you have the files for Level_01 inside the AssetBundles folder, I'm guessing they are not there which would be what's giving you the NullReferenceException. If they aren't there, make sure you downloaded the project correctly.