0
Cannot Reproduce

Missing AOT Stub

Real World 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 25

Since updating to Bolt 1.3 our WebGL build is not being built correctly by our build server. We're calling PreCloudBuild and it seems to be failing with this error: 

build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075] ArgumentException: Version string portion was too short or too long.
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075]   at System.Version+VersionResult.SetFailure (System.Version+ParseFailureKind failure, System.String argument) [0x00016] in /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/version.cs:499 
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075]   at System.Version+VersionResult.SetFailure (System.Version+ParseFailureKind failure) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/version.cs:492 
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075]   at System.Version.TryParseVersion (System.String version, System.Version+VersionResult& result) [0x00029] in /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/version.cs:387 
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075]   at System.Version.Parse (System.String input) [0x00023] in /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/version.cs:362 
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075]   at System.Version..ctor (System.String version) [0x00014] in /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/version.cs:92 
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075]   at AncientLightStudios.uTomate.UTils.MigrateActionIfRequired[T] (T action, System.String versionIntroducingTheChange, System.Action`1[T] migration) [0x00022] in /FuzzyCI/BackEnd/Branches/Dev/workspace/BES-BF-WEB/Bestwood.unity/Assets/FuzzyCI/Common/uTomate/Editor/UTils.cs:431 
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075]   at AncientLightStudios.uTomate.UTSetPlayerSettingsPcMacAction.OnEnable () [0x00024] in /FuzzyCI/BackEnd/Branches/Dev/workspace/BES-BF-WEB/Bestwood.unity/Assets/FuzzyCI/Common/uTomate/Editor/Actions/UTSetPlayerSettingsPcMacAction.cs:196 
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.075] UnityEditor.AssetDatabase:LoadMainAssetAtPath(String)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.WhereSelectArrayIterator`2:MoveNext()
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.<OfTypeIterator>d__33`1:MoveNext()
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.SelectManySingleSelectorIterator`2:MoveNext()
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.<OfTypeIterator>d__33`1:MoveNext()
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] Ludiq.<Concat>d__0`1:MoveNext() (at C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Runtime\Utilities\LinqUtility.cs:16)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] Ludiq.<FindAllProjectStubs>d__2:MoveNext() (at C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Editor\Platforms\AotPreBuilder.cs:95)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.DistinctIterator`1:MoveNext()
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.SelectEnumerableIterator`2:ToArray()
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.Buffer`1:.ctor(IEnumerable`1)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] System.Linq.<GetEnumerator>d__3:MoveNext()
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] Ludiq.AotPreBuilder:GenerateStubScript(String, IEnumerable`1) (at C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Editor\Platforms\AotPreBuilder.cs:187)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.076] Ludiq.AotPreBuilder:GenerateStubScript(String) (at C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Editor\Platforms\AotPreBuilder.cs:66)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] Ludiq.AotPreBuilder:PreCloudBuild() (at C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Editor\Platforms\AotPreBuilder.cs:250)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] <Execute>c__Iterator0:MoveNext() (at Assets/FuzzyCI/Custom/Editor/Scripts/UTBoltAOTBuild.cs:19)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] AncientLightStudios.uTomate.<ExecutePath>c__Iterator1:MoveNext() (at Assets/FuzzyCI/Common/uTomate/Editor/AutomationPlan/UTAutomationPlan.cs:139)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] AncientLightStudios.uTomate.<ExecutePath>c__Iterator1:MoveNext() (at Assets/FuzzyCI/Common/uTomate/Editor/AutomationPlan/UTAutomationPlan.cs:139)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] AncientLightStudios.uTomate.UTomateRunner:ContinueRunning() (at Assets/FuzzyCI/Common/uTomate/Editor/UTomateRunner.cs:185)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077]  
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] (Filename: /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/version.cs Line: 499)
build    30-Apr-2018 09:04:36    [2018-04-30 08:04:36.077] 
Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

I can reproduce this by running it in the editor with the configuration set to by calling PreCloudBuild() on an editor script

ArgumentException: Version string portion was too short or too long.
System.Version+VersionResult.SetFailure (System.Version+ParseFailureKind failure, System.String argument) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
System.Version+VersionResult.SetFailure (System.Version+ParseFailureKind failure) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
System.Version.TryParseVersion (System.String version, System.Version+VersionResult& result) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
System.Version.Parse (System.String input) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
System.Version..ctor (System.String version) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
AncientLightStudios.uTomate.UTils.MigrateActionIfRequired[T] (T action, System.String versionIntroducingTheChange, System.Action`1[T] migration) (at Assets/FuzzyCI/Common/uTomate/Editor/UTils.cs:431)
AncientLightStudios.uTomate.UTSetPlayerSettingsPcMacAction.OnEnable () (at Assets/FuzzyCI/Common/uTomate/Editor/Actions/UTSetPlayerSettingsPcMacAction.cs:196)
System.Linq.<OfTypeIterator>d__33`1:MoveNext()
Ludiq.<Concat>d__0`1:MoveNext() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Utilities/LinqUtility.cs:16)
Ludiq.<FindAllProjectStubs>d__2:MoveNext() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Platforms/AotPreBuilder.cs:95)
System.Linq.<GetEnumerator>d__3:MoveNext()
Ludiq.AotPreBuilder:GenerateStubScript(String, IEnumerable`1) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Platforms/AotPreBuilder.cs:187)
Ludiq.AotPreBuilder:GenerateStubScript(String) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Platforms/AotPreBuilder.cs:66)
Ludiq.AotPreBuilder:PreCloudBuild() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Platforms/AotPreBuilder.cs:250)
UTBoltAOTBuild:test() (at Assets/FuzzyCI/Custom/Editor/Scripts/UTBoltAOTBuild.cs:27)
Not a Bug

Hi Real World,

It seems like the error is coming from uTomate, not Bolt:

AncientLightStudios.uTomate.UTils.MigrateActionIfRequired[T] (T action, System.String versionIntroducingTheChange, System.Action`1[T] migration) (at Assets/FuzzyCI/Common/uTomate/Editor/UTils.cs:431)
AncientLightStudios.uTomate.UTSetPlayerSettingsPcMacAction.OnEnable () (at Assets/FuzzyCI/Common/uTomate/Editor/Actions/UTSetPlayerSettingsPcMacAction.cs:196)

Please forward this bug report to them!

Ok. I think you're right, that may be a red herring as the AOT file is generated but it's failing on WebGL still because of missing AOT values and I was wrong, it's also failing on iOS. Heres the error I get from WebGL

ExecutionEngineException: Attempting to call method 'Ludiq.InstanceFunctionInvoker`5[[VisualMenuManager, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null],[NodeMenuBase, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null],[VisualMenuManager+MenuTransitionRules, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null],[System.Object[], mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089],[System.Collections.IEnumerator, mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089]]::.ctor' for which no ahead of time (AOT) code was generated.
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  (Filename: currently not available on il2cpp Line: -1)

Just to clarify this has only started happening since I updated to 1.3 from 1.2.4

Is it VisualMenuManager+MenuTransitionRules that it can't find? If so then thats an enum and its in the list of defined types


Are you sure the AOT pre-build completes without any error?

That seems like a missing AOT stub.

I'm logging a message before and after PreCloudBuild and between the two calls there are no error reported. The AOT file is generated it's just missing this enum. Is there any way I can force this? I've got a submission to the app store coming up very soon and my iOS and WebGL builds are both unplayable at the moment

Pending Review

The method it can't find is:

'Ludiq.InstanceFunctionInvoker`5[[VisualMenuManager, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null],[NodeMenuBase, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null],[VisualMenuManager+MenuTransitionRules, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null],[System.Object[], mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089],[System.Collections.IEnumerator, mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089]]::.ctor'

Which is a really complicated way of saying that the method in question has this signature:

VisualMenuManager.SomeMethod(NodeModuleBase, VisualMenuManager.MenuTransitionRules, object[], IEnumerator)

Can you find where you'd be using such a method in your graphs? It would help us debug what's causing the AOT pre-build to skip it. Likewise, if you find what SomeMethod is called, check if it's actually being skipped in the AotStubs.cs file.

Looking at the pre-1.3 AOT file and the newest AOT file side by side, it seems to confirm that the function is 

IEnumerator VisualMenuManager.PushMenu(NodeModuleBase, VisualMenuManager.MenuTransitionRules, object[]);

This function isn't in the newest AOT file but it was in the old one

Which is a direct call to a C# function. I had stopped using that and started moving to a new system where I call a custom unit instead so I've only managed to find one place where this still existed in a macro and only one place further where this macro was being used. I've fixed both and yet the error persists...

Ok, I've cleared that error by finding a macro asset that didn't get removed from the build server despite it being removed from source control. That still doesn't fully explain the problem away however as surely the AOT generation should pick it up? If Unity is finding it and trying to call it then surely the AOT should be picking it up too? I don't know why it stopped being included in the generated file after the 1.3 upgrade.

Aside from that, I'm no further forward because now I'm getting this error

ExecutionEngineException: Attempting to call method 'Ludiq.StaticFunctionInvoker`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089]]::.ctor' for which no ahead of time (AOT) code was generated.

Hm, it does sound like AOT pre-build is having a hard time.

Is this error only happening on cloud build, or do you also get it when building manually?

Also, when exactly is the error occurring? What is the stack trace?

I havent tried building for device manually yet as it takes a while and I've been busy getting on top of other issues. I'll try as soon as I can. 

The error seems to occur as its loading in the scene with my graph in it. The stack trace doesnt look very helpful either

blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:8088 ExecutionEngineException: Attempting to call method 'Ludiq.StaticFunctionInvoker`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089]]::.ctor' for which no ahead of time (AOT) code was generated.
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
 
(Filename: currently not available on il2cpp Line: -1)
_JS_Log_Dump @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:8088
__ZL20InternalErrorConsolePKcz @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:96803
__Z40DebugStringToFilePostprocessedStacktraceRK21DebugStringToFileData @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:16032
__ZN9Scripting12LogExceptionE21ScriptingExceptionPtriPKcb @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:15007
__ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:8064
__ZN19ScriptingInvocation13InvokeCheckedEP21ScriptingExceptionPtr @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:19828
__ZN13MonoBehaviour9CallAwakeEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:26361
__ZN13MonoBehaviour12AddToManagerEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:38533
__ZN9Behaviour13AwakeFromLoadE17AwakeFromLoadMode @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:26360
__ZN13MonoBehaviour13AwakeFromLoadE17AwakeFromLoadMode @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:26358
__ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadMode @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:42742
__ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:55048
__ZN18LoadSceneOperation21CompleteAwakeSequenceEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:20364
__ZN18LoadSceneOperation25PlayerLoadSceneFromThreadEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:20361
__ZN18LoadSceneOperation19IntegrateMainThreadEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:25783
__ZN14PreloadManager26UpdatePreloadingSingleStepENS_21UpdatePreloadingFlagsEi @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:27433
__ZN14PreloadManager16UpdatePreloadingEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:39013
__ZZ23InitPlayerLoopCallbacksvEN38EarlyUpdateUpdatePreloadingRegistrator7ForwardEv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:71139
__Z10PlayerLoopv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:15462
__ZL8MainLoopv @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:52298
dynCall_v @ blob:http://ota.fuzzyfrog.io:8800/091b9e23-6a2f-4719-909c-440e6744d373:181641
browserIterationFunc @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9375
runIter @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:8775
Browser_mainLoop_runner @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9413
requestAnimationFrame (async)
requestAnimationFrame @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9065
Browser_mainLoop_scheduler_rAF @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9331
Browser_mainLoop_runner @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9417
requestAnimationFrame (async)
requestAnimationFrame @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9065
Browser_mainLoop_scheduler_rAF @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9331
Browser_mainLoop_runner @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9417
requestAnimationFrame (async)
requestAnimationFrame @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9065
Browser_mainLoop_scheduler_rAF @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9331
Browser_mainLoop_runner @ blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:9417


So building locally seems to work but so does building on our build server if we nuke the checkout completely before starting. If we do an update and rebuild then the error comes back. It's always the same one now about

blob:http://ota.fuzzyfrog.io:8800/1d9952df-1c12-4cce-84bf-c1a7c9ad64cc:8088 ExecutionEngineException: Attempting to call method 'Ludiq.StaticFunctionInvoker`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089]]::.ctor' for which no ahead of time (AOT) code was generated.


I've turned off AOT safe mode from the Ludiq project settings and the error seems to have gone... for now

I see. Make sure your VCS system doesn't somehow delete Ludiq.Core/Generated/AotStubs.cs. If it does, the AOT pre-build step is basically cancelled.

The AotStubs file exists at the end of the build process and is identical to the one built locally

Aaaaand the problems back. Safe Mode setting hasnt changed. All that changed between a working and broken build was I switched to a development build and then back to a submission build

Is there somewhere I can figure out what its struggling to find the AOT stub for? It sounds like a simple boolean type, but surely you dont need a stub for a bool?

I know this is one of those bugs you would rather went away because its probably impossible to reproduce but I am really at a loss here. I've just discovered that Android wasn't running IL2CPP. Turning this on has introduced the same AOT boolean error on those builds too. This is despite the build being on a completely different machine (Windows rather than Mac). One build fails, the next may be fine. There's no logic to it that I can see. If there was some way to force this boolean stub into AOT stubs just to make it be quiet I'd be over the moon

You can force add your own AOT stubs sure, just create any new script file with a single static class marked with the [Preserve] attribute. Then, follow the conventions from the existing AOTStubs.

If you're certain that for some reason the missing one is :

ExecutionEngineException: Attempting to call method 'Ludiq.StaticFunctionInvoker`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089]]::.ctor' for which no ahead of time (AOT) code was generated.

Then you can create a stub for a StaticFunctionInvoker<bool>.

But I'd be more interested in figuring out why the stub doesn't get generated in the first place.

Can you find a place, somewhere in your graphs, where you invoke a static function with zero arguments that returns a bool? This would be the missing stub, and maybe we can infer why it doesn't get auto-generated.

There are 4 different cases where I call a static function that take no parameters and returns a bool. Any way to narrow it down?

Well you can look in the AOTStubs.cs file which of these four do get generated (the comment above the stub is the method/property name). If none of them get generated, we know we have a problem for these in general.

I'll look out in builds that fail to see if there's any difference. I just generated AOT on my PC and all 4 were present but as I said, this issue is intermitent


One other thing you could try in that case is adding the [Preserve] attribute to the stubs generated for these methods. Usually, I never found this to be necessary, but maybe for some reason the Unity code stripping is more aggressive in your project. I'll make sure to automatically add [Preserve] to both the root class and all the method stubs in v.1.4.

Ok just had it happen again. Compared the stubs file to a working build and there are a LOT of missing functions. Guess this one is just the first one it hits when loading the graphs.

I can't see any connection between all the missing functions though. There are static ones, non static ones, functions that exist in a macro  and functions that dont

Are you still generating this via cloud build?

If so, let's take a step back to isolate the issue.

  1. Generate the AOT Stubs
  2. Add the [UnityEngine.Preserve] attribute to the generated AotStubs class
  3. Build for an IL2CPP platform locally
  4. Test if that works

If it works, then we can incrementally start changing step 2, then step 3, and seeing where it breaks.

Cannot Reproduce

Seeing as you didn't reply in over a month, I'm closing this bug report. Let me know if you manage to isolate the issue.

Having cleared the error from the original post I can no longer see any errors between AOT build starting and ending