VContainer
VContainer copied to clipboard
VContainer CodeGen Assembly
Hey there,
I ran into an issue with trying to build an iOS project and I believe it has something to do with CodeGen.
I spent a day or so trying to build an iOS project (Unity 2021.2f6) and the builds were failing over and over again with a System.IO error saying couldn't load assembly MessagePipe, which I'm also using.
After looking at the logs, I could see that it had to do with the "VContainer.Editor.CodeGen.VContainerILPostProcessor" which looked to be processing every assembly in the project even though those assemblies weren't referenced in the same assembly as the VContainer.Enable.CodeGen.
Once I removed the VContainer.Enable.CodeGen assembly, I was able to build successfully.
I had two separate assemblies that referenced VContainer, VContainer.MessagePipe, and VContainer.Enable.CodeGen in the project. Could that have been the issue?
:memo: I'm about to try it on my own project, so I'll fix the problem when the time comes.
Hello,
It seems this issue is still ongoing (Unity 2021.3.8f1 / Android). It was working fine before I upgraded from Unity 2020. I removed code gen from any assembly that references MessagePipe and it removed the errors. Obviously this is a temporary solution so I tried looking into the cause of this issue but I don't know much about code generation. I tried adding breakpoints and following the code but the best I could discover is that that loading MessagePipe assembly returns null during the code gen process. Maybe it has to do with domain reloading and the assembly hasn't been reimported by the time code gen starts.
I'll open an issue on the MessagePipe repository as well and see if they can help with it.
This problem is probably unsolved, but since Source Generator has been released, please use this instead. https://vcontainer.hadashikick.jp/optimization/source-generator