Search Unity

Can't build for UWP because "Reference Rewriter found some errors..."

Discussion in 'Windows' started by Mikael-H, Dec 26, 2017.

  1. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    I get several errors which look to me like Unity tests dll is for some reason trying to be included in th build. This is with .Net scripting backend. Il2cpp works but I can't use that for my project.

    First i get this error:

    Reference Rewriter found some errors while running with command --target="Temp\StagingArea\UnityEngine.TestRunner.dll" --additionalreferences="Temp\StagingArea","C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0\Facade","C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.ApplicationModel.Calls.CallsVoipContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.ApplicationModel.SocialInfo.SocialInfoContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.ApplicationModel.StartupTaskContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.Devices.Custom.CustomDeviceContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.Devices.DevicesLowLevelContract\3.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.Devices.Printers.PrintersContract\1.0.0.0","C:\Program Files (x86)\Windows
    ... and it goes on like this....


    Then I get 1 error like this:

    Reference rewriter: Error: method `System.Double System.DateTime::ToOADate()` doesn't exist in target framework. It is referenced from UnityEngine.TestRunner.dll at UnityEngine.TestTools.TestRunner.TestResultSerializer UnityEngine.TestTools.TestRunner.TestResultSerializer::MakeFromTestResult(NUnit.Framework.Internal.TestCaseResult).
    UnityEngine.Debug:LogError(Object)
    PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:983)
    PostProcessWinRT:process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:211)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    and about 10 errors like this:

    Reference rewriter: Error: method `System.Reflection.FieldInfo System.Type::GetField(System.String,System.Reflection.BindingFlags)` doesn't exist in target framework. It is referenced from UnityEngine.TestRunner.dll at System.Void UnityEngine.TestTools.TestRunner.TestResultSerializer::RestoreTestResult(NUnit.Framework.Internal.TestCaseResult).
    UnityEngine.Debug:LogError(Object)
    PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:983)
    PostProcessWinRT:process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:211)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    I tried deleting all unit tests but that changed nothing.

    I can't reproduce this, my project has tons of dependencies and is too large to send so I'm not sure I could make a proper bug report of this. Not sure it is a bug, could be something I messed up somewhere :D
     
  2. HaraldNielsen

    HaraldNielsen

    Unity Technologies

    Joined:
    Jun 8, 2016
    Posts:
    139
    Mikael-H and Peter77 like this.
  3. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309