[Bug] AOT Error on build

RichardJaquish

New member
Hi,

We're experiencing a problem with UIS on device builds where it reports the following AOT error:
ExecutionEngineException: Attempting to call method 'Opsive.UltimateInventorySystem.Core.AttributeSystem.Attribute`1[[UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.ctor' for which no ahead of time (AOT) code was generated.

This seems to originate from a call to Opsive.UltimateInventorySystemManager.AddDatabase().

Everything works fine in editor, we see this on both the iOS and Windows builds we are trying to test.

Any help would be appreciated!
Thanks.
 
Hi Justin, thank you for the response.

I am using 'low' stripping as there is no option for disabled.

I have created the 'link.xml' file as you suggested and placed it in the root of the 'assets' folder. Here is the contents of the link.xml file I created. Does it look correct?

<linker>
<!--Fully qualified assembly name-->
<assembly fullname="Opsive.UltimateInventorySystem.Core.AttributeSystem, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="Opsive.UltimateInventorySystem.Core.AttributeSystem.Attribute" preserve="all"/>
</assembly>
</linker>

Additionally, I have provided an in-game screenshot of the error in case it provided any additional context for you.

Thanks.
 

Attachments

  • Unity Error_small.png
    Unity Error_small.png
    990.5 KB · Views: 8
I am not sure what the link.xml file should look like with generic variables, but you could try:

Code:
<linker>
<!--Fully qualified assembly name-->
<assembly fullname="Opsive.UltimateInventorySystem.Core.AttributeSystem, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
   <type fullname=" Opsive.UltimateInventorySystem.Core.AttributeSystem.Attribute`1[[UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]" preserve="all"/>
   <type fullname=" Opsive.UltimateInventorySystem.Core.AttributeSystem.Attribute`1[UnityEngine.Color]" preserve="all"/>
   <type fullname=" Opsive.UltimateInventorySystem.Core.AttributeSystem.Attribute<UnityEngine.Color>" preserve="all"/>
</assembly>
</linker>

Is it just the color variable type that is causing problems? Does it work if you remove that attribute?
 
Hi Justin, thanks for your further input.

I still cannot get it to work with your suggestions. The problem seems to be built in to the Ultimate Inventory System as that error is not coming from anything I've added.

You can replicate the problem by doing the following:
  • Create a new project and import "Ultimate Character Controller", "Ultimate Inventory System" and then adding the UIS integration to UCC.
  • Add the demo "Scene" file from "Opsive/UltimateCharacterController/Integrations/UltimateInventorySystem/Demo" folder to the scenes in build project settings.
  • Change the compiler to use "IL2CPP" and perform a "PC, Mac & Linux Standalone" build.
  • It will build successfully, but demo executable will not work properly due to the error. You will not be able to pick up items, and your inventory will be empty.

You will need some way of seeing the log output (I used an on-screen reporter asset) and then you should see exactly the same error message.

Hopefully that helps with finding a fix for the bug.
 
What version of Unity are you using? I just built an IL2CPP build and am unable to reproduce the error after picking up an item.
 
Edit: I was able to repro it.. Looking into it now. We will have it fixed for the next update.
 
Last edited:
Top