Reputation: 43
I am using Untiy to build an AR-App for the HoloLens using Vuforia. I'm using a marker to place several objects in reference to the markers position. Nothing spectectular. No scripts written yet. The following error-message is popping up from time to time. I have no idea what caused it to occure. I can't get the context to something I did in unity. Also, the build succeeds even though the error-message is present. How is it possible to get it away? I am not even able to comprehend its importance because there is no noticable effect to the app.
The only thing I suspect to be the cause: a short while before the error occured first I updated Vuforia. Is it possible to be the cause for this?
NullReferenceException: Object reference not set to an instance of an object
Vuforia.EditorClasses.ImageTargetEditor.DrawPredefinedTargetInspectorUI (Boolean typeChanged)
Vuforia.EditorClasses.ImageTargetEditor.OnInspectorGUI ()
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1295)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Edit: This is no duplicate of What is a NullReferenceException, and how do I fix it? because the meaning of the Exception is known. I don't know what the Exceptions cause is and how to fix it in unity because it origins in code not written by me.
Upvotes: 4
Views: 2509
Reputation: 1
This is happening because of the Image Target not having the Script "Image Target Behaviour". So, Remove Image Target Preview from the object and then add Image Target behaviour and the error will sort out.
Upvotes: 0
Reputation: 31
Can you tell me what is the version of Vuforia SDK you're using?
One possibility for this error would be that, the Unity version (5.6.1f3 in this case) isn't supported with the Vuforia SDK version you're using.
I would suggest updating your Vuforia SDK (if it's not the same) to the latest (v6.2.10 now). You can download it here.
Also I would suggest opening the SDK in an empty project initially since this can happen if any of the script is having a compile error when you're trying to import the SDK into an existing project,
Upvotes: 0