AOT Build doesn't support Remote Projects / DLC

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

That’s the only possible solution currently, as far as I’m aware.

Hi DLC graph is indeed something that is not currently supported. But this is in our roadmap and this is something that we will tackle soon. So right now you don’t have any other choice by having a graph in your main project with the nodes you’ll eventually use.

Thanks for your helps. I’m currently not limited to IL2CPP since I’m developing for Oculus Quest and the App Labs / Oculus Store still support 32 bits apks (although not for too long). So I’ll switch to Mono, use that reflection for now. Still, looking forward for the DLC Graph.

I also read this. It’s a bit outdated and the links are broken, but JoshPeterson talked about a custom build configuration, or build process… Is it something I should look into, or it won’t really help?

I checked with Josh and this solution is indeed really old and won’t help you with the DLC graphs. The problem remains the same as you need to know by advance which APIs you will trigger with you graphs. Sorry for not unblocking you, but keep up to date as this one of the big topic we will start working on soon.