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

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:

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.

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.

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.

There is a fix for a similar issue in 2022.3.17f1. The changelog entry (from this page) is “Fixed Resource scripts being stripped from Player Builds”

The latest release for the stream is 2022.3.28f1. If possible, updating could fix the code stripping behavior.

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!