Search code examples
c#unity-game-enginecompiler-errorsunity-webgl

Unable to compile Unity WebGL after updating to Unity 2019.3


I have a Unity 2019.2 project the I just updated to Unity 2019.3, there were no errors in the editor upon opening the project, I can even build to Windows devices in a .exe form just fine. So I started developing some features, everything was fine, it still builds on Windows. so I try to switch my platform to WebGl. everything appears to be fine, I can even run my project. But as soon as I hit build, I get the following errors: (Each error is separated by a line)

Library\PackageCache\[email protected]\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(185,13): error CS1069: The type name 'PoseData' could not be found in the namespace 'UnityEngine.XR.Tango'. This type has been forwarded to assembly 'UnityEngine.ARModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'AR' in the Package Manager window to fix this error.

Library\PackageCache\[email protected]\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(186,17): error CS0103: The name 'TangoInputTracking' does not exist in the current context

Library\PackageCache\[email protected]\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(186,91): error CS0103: The name 'PoseStatus' does not exist in the current context

Error building Player because scripts have compile errors in the editor

Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player because scripts have compile errors in the editor
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00275] in <6f28216fea9f453abf2e05b770ed3ee4>:0 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <6f28216fea9f453abf2e05b770ed3ee4>:0 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

After attempting to build in WebGL I can no longer run the project in the editor, however if I switch my platform back to Windows, the error disappears and I can run the project in the editor and even compile for Windows. but switching back to WebGL and trying to compile breaks it again.

It appears to have something to do with the way Unity 2019.3 is now based on packages, but I can't tell if it's a UI issue, input system issue, or any other number of endless issues. Can anyone else decipher the errors and offer a solution?

Edit: After trying to update the Unity XR in the Package Manager I now get the following errors, this time the errors come up just be switching the platform instead of having to build for it:

Library\PackageCache\[email protected]\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(188,13): error CS1069: The type name 'PoseData' could not be found in the namespace 'UnityEngine.XR.Tango'. This type has been forwarded to assembly 'UnityEngine.ARModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'AR' in the Package Manager window to fix this error.

Library\PackageCache\[email protected]\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(189,17): error CS0103: The name 'TangoInputTracking' does not exist in the current context

Library\PackageCache\[email protected]\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(189,91): error CS0103: The name 'PoseStatus' does not exist in the current context

Solution

  • One way or another when updating to Unity 2019.3 it appears Unity automatically installed a package called "XR Legacy Input Helpers" See Reference Image, I tried updating the package by opening the Package Manager a updating the package, however this just caused more errors.

    I found that removing the package worked since nothing was using it and I don't know why Unity even installed it. If I were using this package though I don't know what I would've done.

    Thanks to @BugFinder & and @Ankit for helping me find the solution to my problems.