- Home /
Quest build fails GetScriptsHaveMouseEvents
I am trying to build my project for the Quest and I keep getting a build failure. The error messages are:
NullReferenceException: Object reference not set to an instance of an object UnityEditor.AssemblyReferenceChecker.CollectReferencedAndDefinedMethods (Mono.Cecil.TypeDefinition type, System.Boolean isSystem) (at C:/buildslave/unity/build/Editor/Mono/Utils/AssemblyReferenceChecker.cs:152) UnityEditor.AssemblyReferenceChecker.CollectReferencedAndDefinedMethods (System.Collections.Generic.IEnumerable`1[T] assemblyDefinitions) (at C:/buildslave/unity/build/Editor/Mono/Utils/AssemblyReferenceChecker.cs:126) UnityEditor.AssemblyReferenceChecker.CollectReferences (System.String path, System.Boolean collectMethods, System.Single progressValue, System.Boolean ignoreSystemDlls) (at C:/buildslave/unity/build/Editor/Mono/Utils/AssemblyReferenceChecker.cs:117) UnityEditor.AssemblyReferenceChecker.GetScriptsHaveMouseEvents (System.String path) (at C:/buildslave/unity/build/Editor/Mono/Utils/AssemblyReferenceChecker.cs:292) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at C:/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:122)
And
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:95 UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at C:/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:122)
The most specific method I see in here is GetScriptsHaveMouseEvents, so I think that's the direction I need to go, but when I search for that method I only get 4-year old posts related to Unity 4 and 5 and Cardboard VR.
I checked my entire solution for the term 'mouse' and removed the OnMouseDown checks from my part of the code. But I see that in the Oculus folder and in Standard Assets there are numerous references to the mouse as well. And another project for Quest builds fine, so I don't think the Oculus stuff is the problem.
Can someone tell me what is going wrong and where to look?
Some more background info: I searched for other methods in the error message and found that the build failure might be related to objects having a script component that no longer existed. I found 3 of them and removed them expecting that this was the reason for the 3 errors in the second message, but the error still remains.
The project is originally developed for HTC Vive and I am migrating it now to the Quest. The scene I'm working on plays without any errors in the editor.
I am using Unity 2019.2.17
Edit:
After commenting out all references to mouse in my own code, deleting Standard Assets, TextMeshPro examples, Unity-UI-Extensions (expect for the scripts that I am using) I now only have mouse references in the Oculus folder and they are the same as in another project that builds fine.
I also deleted all other scenes except the one I am testing, to prevent missing scripts in (not-used) scenes to influence the build project. I compared the build settings for the project that builds fine and this project and aligned them. Buit nothing makes a difference.
Please help.
Your answer
Follow this Question
Related Questions
Simultaneous pulling problem 0 Answers
How to detect button down/up in xr interaction toolkit in unity xr oculus? 0 Answers
Why audio is getting distorted at a certain point in Oculus Quest? 0 Answers
Help importing personalized Oculus avatar 0 Answers
,Flicking render textures Oculus Quest 0 Answers