-
-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MissingMethodException on Create_ValueType_RefType with AOT and Unity #647
Comments
I think the problem is in the stripping of the method or the generation of generics, but I have not been able to reproduce it. |
We were able to come up with minimum repro, you can find it here: https://github.com/taras-strypko/unity-magic-onion-repro/tree/master. It consists of two branches:
The magic_onion_4_5_2 branch works fine, but it generated invalid code (you can run ./code_generation.sh to roll these changes back). We have manually added missing global usings to MagicOnion.Generated.cs in order to fix this issue. Please note that we removed ios runtime from GRPC plugins (Assets/Plugins/GRPC.Core/runtimes/ios) as it was too large for github and not significant for this specific case. How to repro:
|
We were able to successfully run mini repro and our main project by removing Scripts/MagicOnion folder entirely and manually uploading
Not sure if this can be considered a proper fix, but it seems to be working fine. We will continue internal testing this way, but ultimately would like to know why it happened and what would be the right way to fix it. Hopefully this will help you investigate the root cause, please let us know if you need any additional info. Will keep you posted as well. |
Thank you for providing a repro project! The cause is a conflict between the version of MagicOnion.Shared code included in MagicOnion.Client in the Unity package and the compiled MagicOnion.Shared.dll for .NET (NuGet). For Unity, MagicOnion.Shared does not have a separate DLL (asmdef), while MagicOnion.Shared for NET has a separate DLL. This gap causes this problem. The current release of MagicOnion is not intended to include the generated code as a compiled DLL in Unity projects. We will consider removing MagicOnion.Shared from the dependency, but until then, you will need to either include the generated source code in your Unity project or separate MagicOnion.Shared in the Unity project using Assembly Definition (asmdef). |
Can we rely on the "fix" I mentioned above? Removing unity package for magic onion and manually including MagicOnion-related dlls seems to be working for us, will know for sure once we finish testing on real android/ios devices. We will see if it is possible to include generated source code with our current setup as it most likely will require major changes in the build pipeline. Could you elaborate on the "include separate MagicOnion.Shared in the Unity project via asmdef" option, not sure I understand this one. Thanks! |
It worked! Will stick to this option for now and proceed with testing, thank you! |
Hi,
we are upgrading from a very old MagicOnion version (most likely haven't been touched since 2019/2020) to 5.1.7.
We do use mpc and moc on our Shared project for AOT codegen.
This is the error we get from Unity editor (real file names/namespaces have been stripped/replaced with placeholders
):
The way we upgraded:
Is there anything we are missing here?
The text was updated successfully, but these errors were encountered: