YAML Class ID Reference

Recently have encountered “Could not produce class with ID 255” runtime error. The project enables “Strip Engine Code”. I have searched through YAML Class ID Reference documentation but couldn’t find class name that has ID of 255. Could someone help me find this class name? Even for future reference, it would help if someone can tell me how I would find these class IDs that are not documented.

Class 255 is FixedJoint2D.

I have a similar issue, but for ID 331. What class has ID 331? The docs do not contain a reference to it.

331 is SpriteMask.

Thank you very much!

@superpig The YAML Reference page doesn’t seem very up to date. I couldn’t find SpiteMask in there. Right now I have the problem of my Standalone app to not produce class ID 362. Is it possible to look them all up by myself, or is this the post to ask for missing IDs?

Ayways, what is 362?

I believe 362 is the WorldAnchor type.

Thanks a bunch, that was it. Where did you get the information?
Is it considered a bug that having one in the scene and building for Windows Standalone for server purposes generates the error “Could not produce class with ID 362” and crashes with crash dump on closing?

I looked it up in the source code.

So, the crash on closing is certainly something that should not happen. As for whether the error should be produced - given that WorldAnchor is part of UnityEngine.XR.WSA, I assume it is only available when building for Universal Windows Platform, and not for Windows Standalone - but a better error message would not go amiss. I’ll point the XR team at this thread, so we can see if they already know about this.

How can we get the missing IDs by ourselves when it’s not documented ?

1 Like

Hmm… you’d need to use reflection, but the best way is probably to call UnityEditor.UnityType.FindTypeByPersistentTypeID(), and then check the name property of the result.

Seems the crash does not come from the Wo

That was the last answer to my questions :slight_smile: thanks

Alternatively, if you force text serialization, you can search your way to the problematic class, which is what I usually do.

$ ag -G "\.(unity|prefab|asset)$" -C 2 -w "331" Assets/
Assets/Game/Something/MyScene.unity
15723-  m_RootOrder: 4
15724-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
15725:--- !u!331 &1229346169
15726-SpriteMask:
15727-  m_ObjectHideFlags: 0

And bam - there we go, 331 is SpriteMask. This is probably less reliable than using reflection, but much much faster, and so far has always worked for me :slight_smile:

Awesome, two solutions at once.

Hi,
I’ve used reflection and FindTypeByPersistentTypeID to find the names of most classes I needed, but there is one special class, which name is different (I guess) in the Editor and in iOS. It’s class id 91. FindTypeByPersistentTypeID returns “AnimatorController”, but this class is only available in the Editor and I guess id 91 is being assigned to another class when exporting for iOS. Unfortunately, FindTypeByPersistentTypeID can be called only in the Editor, so I can’t see which class is assigned to id 91 during runtime. Can you help?
Or maybe there is AnimatorController, but it is not in the default UnityEngine namespace? The docs don’t say anything.

At runtime, AnimatorControllers are represented as a RuntimeAnimatorController. It might be that?

When I put UnityEngine.RuntimeAnimatorController in link.xml it still reports that class id 91 is missing.

@MacroPinch I don’t think it’s reassigned by a different class. Even the call FindTypeByPersistentTypeID has “persistent” in it. How persistent would that be if 91 would be some other class all of a sudden. The closest explanation I have for that is. All classes get an ID assigned to them that stays that way and if the class is stripped out, so be it.

It is indeed the AnimatorController class. RuntimeAnimatorController is 93.

I’ve tried putting several combinations, which include AnimatorController in link.xml, but still get the following warning:

Could not produce class with ID 91.
This could be caused by a class being stripped from the build even though it is needed. Try disabling ‘Strip Engine Code’ in Player Settings.

This is Unity 2018.1.6f1

Here’s my link.xml: