Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug (FIXED) Animation Rigging package doesn't compile in the build

Discussion in 'Animation' started by DanjelRicci, May 13, 2024.

  1. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    316
    My game uses the Animation Rigging package, and when running it on Android I get the following error when checking with Logcat, once for each of the Animation Rigging scripts in my scene characters:

    A scripted object (probably UnityEngine.Animations.Rigging.RigBuilder?) has a different serialization layout when loading. (Read 32 bytes but expected 104 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?


    This is then followed by a long list of warnings that suggest the Animation Rigging scripts are not there at all:

    The referenced script on this Behaviour (Game Object 'name') is missing!


    On device my characters are in fact stuck in T-Pose, while in the editor everything works correctly.
    Inspecting the Animation Rigging package files I noticed the runtime files indeed have various #ifdef UNITY_EDITOR parts which wrap entire functions rather than just the logic. Technically moving the #ifdef inside the functions should fix this but managed packages are not editable.
     
  2. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    847
    You can embed a UPM package by moving it to the Packages folder on disk. That will let you modify the package locally without Unity stomping on it.

    What package version and editor version are you using? These are good pieces of info to have.
     
  3. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    316
    Oh sorry, forgot about that, my bad- Unity 2022.3.11f, Animation Rigging 1.2.1.
    Thanks for the info!

    Anyways, another developer suggested me to try and set Stripping level to Minimal instead of Low, and it actually worked. So the issue looks a bit different from what I thought. Looks like the Animation Rigging package is being stripped on compilation but it's weird, because its components are present on multiple prefabs referenced in Scriptable Objects placed inside the Resources folder.
     
  4. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    847
  5. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    316
    It looks exactly like my issue, glad it's been fixed. I think I will update after releasing the game though, since I'm really close to it. Thanks a lot!