HI, a little context:
We’re using the Multiple Projects Workflow with Addressables. We don’t have Graphs in the main project and we load remote Scenes that have graphs in them. Now, all works well when building with Mono scripting backend, but it gets a bit funky with IL2CPP.
Our problem is the way the AOTStubs is generated. Our understanding of the problem is that the AOT Prebuild iterates through every Graph in every scenes and the Asset folder, and figures out what Nodes is used. It then creates the stubs for them. Since we have no VS in our main project, the remote content that we load doesn’t have the stubs.
More context: Our main project has no VS in it. If, let’s say, we build the main project, and one of the scenes we loaded remotely has a graph that changes the color of a cube to red, nothing happens. If we then add a graph in the main project - anywhere in the Asset Folder - that contains the needed nodes to perform a color change (Meshrenderer.Material, Material.color (set)). We then build the project and load the remote scene, everything works. Also, we never reference the said graph. It only exist in the project and that seems to be enough.
So the question is, is there a way to make this setup work with IL2CPP. Technically, if we had a graphs that contained every possible node before build, it would work but that I’d rather not go there. The desired behaviour would be to generate AOT Stubs for everything that is included in the Settings, or use some link,xml maybe… (though we tried that and, unless we forgot something important, it doesn’t work)
Note: We’ve been reading the AotPreBuilder class and there’s a great comment in it saying:
// Automatically generates the link.xml file to prevent stripping.
// Currently only used for plugin assemblies, because blanket preserving
// all setting assemblies sometimes causes the IL2CPP process to fail.
// For settings assemblies, the AOT stubs are good enough to fool
// the static code analysis without needing this full coverage.
Any insight would be helpful
Unity 2021.1.19
Visual Scripting: 1.7.3
Scripting Backend: IL2CPP
Related:
Addressables 1.19.4