Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

YAML Class ID Reference

Discussion in 'Documentation' started by mleesago, Oct 27, 2017.

  1. mleesago

    mleesago

    Joined:
    Jan 18, 2017
    Posts:
    4
    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.
     
  2. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
    Class 255 is FixedJoint2D.
     
  3. coreystpierre1

    coreystpierre1

    Joined:
    Apr 12, 2017
    Posts:
    2
    I have a similar issue, but for ID 331. What class has ID 331? The docs do not contain a reference to it.
     
  4. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
    331 is SpriteMask.
     
  5. coreystpierre1

    coreystpierre1

    Joined:
    Apr 12, 2017
    Posts:
    2
    Thank you very much!
     
  6. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    53
    @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?
     
  7. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
  8. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    53
    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?
     
  9. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
    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.
     
  10. IOZO

    IOZO

    Joined:
    Jun 26, 2010
    Posts:
    52
    How can we get the missing IDs by ourselves when it's not documented ?
     
    Alexees likes this.
  11. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
    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.
     
  12. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    53
    Seems the crash does not come from the Wo
    That was the last answer to my questions :) thanks
     
  13. zzgrzyt

    zzgrzyt

    Joined:
    Jun 13, 2017
    Posts:
    8
    Alternatively, if you force text serialization, you can search your way to the problematic class, which is what I usually do.

    Code (CSharp):
    1. $ ag -G "\.(unity|prefab|asset)$" -C 2 -w "331" Assets/
    2. Assets/Game/Something/MyScene.unity
    3. 15723-  m_RootOrder: 4
    4. 15724-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
    5. 15725:--- !u!331 &1229346169
    6. 15726-SpriteMask:
    7. 15727-  m_ObjectHideFlags: 0
    8.  
    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 :)
     
  14. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    53
    Awesome, two solutions at once.
     
  15. MacroPinch

    MacroPinch

    Joined:
    Dec 6, 2013
    Posts:
    17
    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.
     
  16. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    3,083
    At runtime, AnimatorControllers are represented as a RuntimeAnimatorController. It might be that?
     
  17. MacroPinch

    MacroPinch

    Joined:
    Dec 6, 2013
    Posts:
    17
    When I put UnityEngine.RuntimeAnimatorController in link.xml it still reports that class id 91 is missing.
     
  18. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    53
    @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.
     
  19. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
    It is indeed the AnimatorController class. RuntimeAnimatorController is 93.
     
  20. MacroPinch

    MacroPinch

    Joined:
    Dec 6, 2013
    Posts:
    17
    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:

    <linker>
    <assembly fullname="UnityEngine">
    <type fullname="UnityEngine.Avatar" preserve="all"/>
    <type fullname="UnityEngine.Rendering.SortingGroup" preserve="all"/>
    <type fullname="UnityEngine.FlareLayer" preserve="all"/>
    <type fullname="UnityEngine.U2D.SpriteAtlas" preserve="all"/>

    <type fullname="UnityEditor.Animations.AnimatorController" preserve="all"/>
    <type fullname="UnityEditor.AnimatorController" preserve="all"/>
    <type fullname="UnityEngine.Animations.AnimatorController" preserve="all"/>
    <type fullname="UnityEngine.AnimatorController" preserve="all"/>
    </assembly>
    </linker>
     
  21. MacroPinch

    MacroPinch

    Joined:
    Dec 6, 2013
    Posts:
    17
    Also tried creating another assembly element for Unity editor

    <assembly fullname="UnityEditor">
    <type fullname="UnityEditor.Animations.AnimatorController" preserve="all"/>
    </assembly>

    but then the export fails with an exception

    Failed running /Applications/Unity/Unity.app/Contents/il2cpp/build/UnityLinker.exe --api=NET_4_6 -out="/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/tempStrip" -l=none -c=link --link-symbols -x="/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.xml" -f="/Applications/Unity/Unity.app/Contents/il2cpp/LinkerDescriptors" -x "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/var/folders/f_/sgs_gnxd1m12fmdzscgtwfw80000gn/T/tmp6570e755.tmp" -x "/var/folders/f_/sgs_gnxd1m12fmdzscgtwfw80000gn/T/tmp1cd467d3.tmp" -x "/var/folders/f_/sgs_gnxd1m12fmdzscgtwfw80000gn/T/tmp59f592a7.tmp" -x "/Applications/Unity/Unity.app/Contents/il2cpp/LinkerDescriptors/System45.xml" -x "/Applications/Unity/Unity.app/Contents/il2cpp/LinkerDescriptors/mscorlib45.xml" -x "/Users/batko/Projects/project9/unity/Assets/link.xml" -d "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed" -a "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll" -a "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" -a "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/NestedPrefabs.dll" -a "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/DOTween.dll" -a "/Users/batko/Projects/project9/unity/Temp/StagingArea/Data/Managed/Rewired_Core.dll"

    stdout:
    Fatal error in Unity CIL Linker
    Mono.Linker.Steps.XmlResolutionException: Unable to find the file for the assembly named 'UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' specified in link file '/Users/batko/Projects/project9/unity/Assets/link.xml'. Should this assembly be in the project? Use the 'ignoreIfMissing="1"' attribute if this assembly may not always exist. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    at Unity.Linker.LocalDirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00076] in <f8d0909297b849a9be283c981f3ca21a>:0
    at Unity.Linker.UnityAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x0001a] in <f8d0909297b849a9be283c981f3ca21a>:0
    at Mono.Linker.LinkContext.Resolve (Mono.Cecil.IMetadataScope scope) [0x00009] in <595db02836e14929974068a4ba156176>:0
    --- End of inner exception stack trace ---
    at Mono.Linker.LinkContext.Resolve (Mono.Cecil.IMetadataScope scope) [0x00048] in <595db02836e14929974068a4ba156176>:0
    at Mono.Linker.Steps.ResolveFromXmlStep.GetAssembly (Mono.Linker.LinkContext context, Mono.Cecil.AssemblyNameReference assemblyName) [0x00001] in <595db02836e14929974068a4ba156176>:0
    at Unity.Linker.Steps.UnityResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) [0x00015] in <f8d0909297b849a9be283c981f3ca21a>:0
    --- End of inner exception stack trace ---
    at Unity.Linker.Steps.UnityResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator iterator) [0x00073] in <f8d0909297b849a9be283c981f3ca21a>:0
    at Mono.Linker.Steps.ResolveFromXmlStep.Process () [0x0003f] in <595db02836e14929974068a4ba156176>:0
    at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x00018] in <595db02836e14929974068a4ba156176>:0
    at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00020] in <595db02836e14929974068a4ba156176>:0
    at Unity.Linker.UnityDriver.Run () [0x00086] in <f8d0909297b849a9be283c981f3ca21a>:0
    at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling () [0x00001] in <f8d0909297b849a9be283c981f3ca21a>:0

    at Unity.Linker.UnityDriver.RunDriver () [0x00002] in <f8d0909297b849a9be283c981f3ca21a>:0
    stderr:
    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:89)
    UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:82)
    UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:203)
    UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:113)
    UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:154)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:35)
    UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions)
    UnityEditorHelper.BundleManager:<startup>b__5_0(BuildPlayerOptions)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)






    Exception: /Applications/Unity/Unity.app/Contents/il2cpp/build/UnityLinker.exe did not run properly!
    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:130)
    UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable`1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:89)
    UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String[] assemblies, System.String[] searchDirs, System.String outputFolder, System.String workingDirectory, System.String& output, System.String& error, System.String linkerPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Collections.Generic.IEnumerable`1[T] additionalBlacklist) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:82)
    UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (System.Collections.IEnumerable assemblies, System.String managedAssemblyFolderPath, System.String[] assembliesToStrip, System.String[] searchDirs, System.String monoLinkerPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:203)
    UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:113)
    UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:154)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:35)
    UnityEditor.iOS.PostProcessiPhonePlayer.CrossCompileManagedDlls (UnityEditor.iOS.PostProcessiPhonePlayer+BuildSettings bs, UnityEditor.iOS.PostProcessiPhonePlayer+ProjectPaths paths, UnityEditor.AssemblyReferenceChecker checker, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport buildReport) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:801)
    UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.PostProcessiPhonePlayer+BuildSettings bs, UnityEditor.iOS.PostProcessiPhonePlayer+ProjectPaths paths, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport buildReport) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:637)
    UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.PostProcessorSettings postProcessorSettings, UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:590)
    UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/ExtensionModule.cs:37)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:285)
    UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions)
    UnityEditorHelper.BundleManager:<startup>b__5_0(BuildPlayerOptions)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  22. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
    There shouldn't be any AnimatorController objects in files that you load at runtime. What are you doing when you get the error?
     
  23. MacroPinch

    MacroPinch

    Joined:
    Dec 6, 2013
    Posts:
    17
    This happens during the initialization of of the app. More specifically while loading an asset bundle, which contains prefabs and scriptable objects.
     
  24. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,044
    It sounds like somehow your AssetBundle contains an AnimatorController object, rather than the RuntimeAnimatorController object that it should contain. Assuming you're not doing anything particularly weird in how you build your bundle, you probably need to file a bug report.