Bolt PreCloudBuild InvalidOperationException when called from command line

I build my project using an automated build system. Bolt would not work on iOS devices, presumably because we need to compile it AOT. I tried calling Ludiq.AotPreBuilder.PreCloudBuild() from both a function called by executeMethod on the command line, and also placing it inside a IPreprocessBuildWithReport. In both cases I get the exceptions InvalidOperationException: Trying to access a plugin container before it is initialized.

What is the correct way to build Bolt from the command line?

The documentation seems to be specifically about Unity Cloud Build (Unity - Manual: Building for Mobile / Consoles)

Unity 2020.3.14

1 Like

I will add that if, inside OnPreprocessBuild, I call Ludiq.AotPreBuilder.DeleteLinker, Ludiq.AotPreBuilder.DeleteStubScript, Ludiq.AotPreBuilder.GenerateStubScrip, or Ludiq.AotPreBuilder.GenerateLinker, I will get a NullReferenceException in Ludiq.LudiqCore.get_Paths

I have filed a bug report with Unity. The AOT build is something that should work from the command line.

Hey, did you ever receive a solution for this?