Search Unity

[SOLVED] Problem with animation after building for Windows

Discussion in 'Animation' started by GUIVASCONCELOS, Aug 16, 2022.

  1. GUIVASCONCELOS

    GUIVASCONCELOS

    Joined:
    Sep 3, 2017
    Posts:
    4
    Hi,

    I'm making an app that is working fine while I'm playing it inside Unity. All animations, buttons, and everything work fine in Unity. However, when I made the build, the animations suddenly stopped working. The animations with problems are triggered by clicking a button. I've made a test playing animations without any trigger and it worked. So, the problem happens when clicking is involved.

    I've tried all the solutions for similar problems that I saw in this (and other) forums: 1) restart Unity, 2) close and reopen the Animator tab; 3) make another Animator and other animations. Nothing worked.

    I've implemented a Debugger in my build and this is what it returns when I click the button that should play the animation. Anybody can help me, please?


    ArgumentNullException: Value cannot be null.
    Parameter name: target
    at UnityEngine.Events.BaseInvokableCall..ctor (System.Object target, System.Reflection.MethodInfo function) [0x00051] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent.cs:126
    at UnityEngine.Events.InvokableCall`1[T1]..ctor (System.Object target, System.Reflection.MethodInfo theFunction) [0x00000] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent.cs:198
    at UnityEngine.Events.CachedInvokableCall`1[T]..ctor (UnityEngine.Object target, System.Reflection.MethodInfo theFunction, System.String argument) [0x00000] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent.cs:352
    at UnityEngine.Events.PersistentCall.GetRuntimeCall (UnityEngine.Events.UnityEventBase theEvent) [0x000bc] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent.cs:476
    at UnityEngine.Events.PersistentCallGroup.Initialize (UnityEngine.Events.InvokableCallList invokableList, UnityEngine.Events.UnityEventBase unityEventBase) [0x00028] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent.cs:655
    at UnityEngine.Events.UnityEventBase.RebuildPersistentCallsIfNeeded () [0x0000c] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent.cs:822
    at UnityEngine.Events.UnityEventBase.PrepareInvoke () [0x00001] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent.cs:858
    at UnityEngine.Events.UnityEvent.Invoke () [0x00001] in C:\buildslave\unity\build\Runtime\Export\UnityEvent\UnityEvent\UnityEvent_0.cs:53
    at UnityEngine.UI.Button.Press () [0x00027] in C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Button.cs:68
    at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00010] in C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Button.cs:110
    at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00001] in C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\ExecuteEvents.cs:50
    at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00074] in C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\ExecuteEvents.cs:262
    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\ExecuteEvents.cs:266)
    UnityEngine.EventSystems.StandaloneInputModule:ReleaseMouse(PointerEventData, GameObject) (at C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:187)
    UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData) (at C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:642)
    UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32) (at C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:548)
    UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent() (at C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:528)
    UnityEngine.EventSystems.StandaloneInputModule:Process() (at C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\InputModules\StandaloneInputModule.cs:282)
    UnityEngine.EventSystems.EventSystem:Update() (at C:\Users\guilh\wkspaces\PowerwallHDRP\Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\EventSystem.cs:385)

    (Filename: C:/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent.cs Line: 126)



    SOLVED: The button I'm using to play the animations had a 'missing object' OnClick() via inspector. When running it through Unity the problem was ignored, but it crashed when built.
     
    Last edited: Aug 16, 2022