Build failed with the sample code

Hi everyone,
I am using the Unity to build the web ar

I tried the below action:
1- I was using the Unity Editor version as 6000.0.8f1 and 2022.3.41f1
2- I downloaded the needle plugin and installed to unity project
3- I downloaded the sample - ā€œFace Filterā€
4- I make sure the needle project validation have been set up
5- Add the scene to ā€œScenes in buildā€
6- Build and run

Error building Player: 4 errors

Build completed with a result of ā€˜Failedā€™ in 83 seconds (82596 ms)
5 errors
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:203)
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.HostView.GetExtraButtonsWidth () (at /Users/bokken/build/output/unity/unity/Editor/Mono/HostView.cs:737)
UnityEditor.DockArea.OldOnGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/DockArea.cs:360)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:355)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:203)
ā€¦

Hi Alan Wong,

It seems youā€™re encountering build errors related to a NullReferenceException when trying to build your Unity project using the Needle Engine. Here are some steps you can follow to troubleshoot the issue:

  1. Check for Missing References: Ensure that all the necessary components and references for the ā€œFace Filterā€ sample are correctly set up in your Unity project. Missing scripts or components can often lead to NullReferenceExceptions.

  2. Unity Version Compatibility: Verify if the versions of Unity you are using (6000.0.8f1 and 2022.3.41f1) are compatible with the Needle Engine version you installed. Sometimes, specific features or components are only available in certain Unity versions.

  3. Needle Engine Setup: Double-check that the Needle Engine is properly set up. Make sure youā€™ve followed all the installation and setup instructions outlined in the documentation. This may include checking project settings such as WebGL support.

  4. Unity Logs: Look at the Unity console for more detailed errors or warnings. You can also check the Editor logs for additional informationā€”these might provide specific lines of code or components causing the issue.

  5. Scene Configuration: Ensure the scene youā€™ve added to ā€œScenes in Buildā€ is correctly configured with the necessary Needle Engine components. Sometimes, UI elements or any specific rendering settings might not be set up well.

  6. Validation Checks: Follow the validation steps in the Needle Engine to ensure everything is in order. Sometimes, running validation can help determine if any components are missing.

If you can provide the output from the Unity logs or any additional errors, it will be easier to pinpoint the exact issue. Let me know if you need further assistance!

3 replies left
thread_9gWsEvCA9QcLMaAO8WZywS10
Reply to this message to continue the conversation

Hi

  • make sure to build for the Needle Platform (not Unity WebGL)
  • Can you show all errors? The one you posted doesnt include anything Needle Engine related
  • Can you include the exact versions of the Needle Engine Plugin youā€™re using?