Skip to content
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

System.Reflection.Emit-using code causes Unity3D IL2CPP compilation fail #161

Open
nrader95 opened this issue Mar 4, 2022 · 3 comments
Open

Comments

@nrader95
Copy link
Contributor

nrader95 commented Mar 4, 2022

As the title states, currently DefaultECS cannot be used with unity3d il2cpp compilation backend due to System.Reflection.Emit code inside framework.
The problem here is that, unlike some other AoT compilation methods, il2cpp does not care if you are using this specific part of the code or nor. Simply having it is enough for a failure, so in order for it to be compatible, .Emit-using code has to be rewritten without its usage.

I did quick and dirty fix for myself by removing affected parts of framework here in my fork repo, so you can look where are the things that causing the problem.

@Doraku
Copy link
Owner

Doraku commented Mar 6, 2022

That's weird, I remember trying it as is with IL2CPP and building a project for both PC and Android. No problem (as long as I didn't call those methods obviously). That was with version 2020.2.3f1, what version are you using? maybe they changed it :/

@nrader95
Copy link
Contributor Author

nrader95 commented Mar 6, 2022

I'm using the 2021.2 version.

@Doraku
Copy link
Owner

Doraku commented Mar 26, 2022

Finally got around to update my Unity. I managed to create a build using IL2CPP for windows, with the version 2021.2.16f1 and netstandard2.1 api. I tried to look into their release notes to see if there was something about it but found nothing. Can you try to see if upgrading your Unity fixes it?
Truth be told this separation is something I had in mind but didn't want to invest time in yet. So I will probably make Default.Serialization as its own package sooner than later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants