Search Unity

Could not produce class with ID 91 (AnimatorController class)

Discussion in 'Addressables' started by litebox, Feb 23, 2020.

  1. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    158
    I moved my game scenes to Addressables and tested in Editor - all work correct. Then I made a build for Android and got error "Could not produce class with ID 91. This could be caused by a class being stripped from the build even though it is needed" - I checked class by it ID here: https://docs.unity3d.com/Manual/ClassIDReference.html
    and found that it is UnityEditor.Animations.AnimatorController, also in my game I noticed all my animations don't play.
    I was able to fix this with disabling "Strip engine code" as it was mentioned in the error itself, but:
    - The class AnimatorController is UnityEditor script, why do it come to the build at all? In my game I use only Animator and Animation classes. Is it a bug? I found similar Issue in Issue Tracker: https://issuetracker.unity3d.com/is...error-when-using-loadassetasync-dot-completed, but it looks "abandoned"
     
  2. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    158
    Also, without "Strip engine code" my app size increased for 12 Mb, which is pretty much. I tried to add link.xml to Assets folder as described here: https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html
    with next content:
    Code (CSharp):
    1. <linker>
    2.     <assembly fullname="UnityEditor">
    3.         <type fullname="UnityEditor.Animations.AnimatorController" preserve="all"/>
    4.     </assembly>
    5. </linker>
    But it doesn't work and seems to me in doesn't support UnityEditor assembly at all.
    Any ideas how this could fixed without adding extra 12 Mb of Unity sources to the build?
     
  3. faolad

    faolad

    Joined:
    Jan 27, 2013
    Posts:
    118
    I was in the same predicament and after trying several things and having some answers from the Unity team, the only conclusion is that addressables cant be used without disabling "Strip engine code", it's supposed to be supported in the future, but it seems that is going to take awhile.
     
  4. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
    There was a known bug (not sure if they fixed it in later versions) where stripping ignores link.xml with Animator. You can fix this by adding an object to one of your built-in scenes with an Animator component on it.
     
  5. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    158
    Somewhy it doesn't work neither with Animator and Animation Components in my built-in Loader Scene :(
    upload_2020-2-27_15-37-22.png
     
  6. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    158
    At the end, the solution of ProtoTerminator is correct: but, don't leave Animator's and Animation's properties empty! In this case the component will be stripped.
     
    Last edited: Feb 27, 2020