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

Issue with release build using il2cpp #33

Open
renanliberato opened this issue Jun 15, 2021 · 5 comments
Open

Issue with release build using il2cpp #33

renanliberato opened this issue Jun 15, 2021 · 5 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@renanliberato
Copy link

renanliberato commented Jun 15, 2021

Bug report

I'm not familiar with this kind of error in Unity... Is it something that can be "worked around" when using the library?
I could run it when building for Android using Mono, but it might be a limitation for people who needs to generate 64 bits APK or HTML5 versions.

Besides that, thanks for the lib! I'm using it to study ECS so not worried much about it.. I'll try to investigate also for learning porpuses and update here later.

Environment

  • Versions
    Unity 2019.4.15f1
    TinyECS v0.4.15

  • Platform
    HTML5, Android

  • Compiler
    IL2CPP

  • Hardware
    Windows PC

Steps to reproduce the issue

  • Add the library source code
  • Remove the TinyECSUnityIntegrationEditor folder (I could not make the release compilation work with it - unity play button works)
  • Create a Scene using a Static View component and DynamicView component
  • Switch the project to HTML5
  • Build a release version.
  • Open it in a browser.

What's the expected result?

  • Systems would run as usual and views updated

What's the actual result?

As soon as the app loads, I get this error:

ExecutionEngineException: Attempting to call method 'TinyECS.Impls.ComponentManager::AddComponent<TinyECSUnityIntegration.Impls.TOnViewWaitForInitEventComponent>' for which no ahead of time (AOT) code was generated.
(Filename: currently not available on il2cpp Line: -1)

Additional details / screenshot

  • I'm using also the ".NET 4.x scripting runtime version" as suggested on the README.
  • This repository is the one I was trying to build using IL2CPP
@bnoazx005 bnoazx005 added bug Something isn't working invalid This doesn't seem right labels Jun 15, 2021
@bnoazx005
Copy link
Owner

bnoazx005 commented Jun 15, 2021

Thanks for your report! I will try to check this problem as soon as possible. For now it looks like incompatibility between Unity's il2cpp and the library.

UPD. Could you please add information about which version of Unity and TinyECS have you used?

@renanliberato
Copy link
Author

Sure!
I'm on:

  • Unity 2019.4.15f1
  • TinyECS v0.4.15

@renanliberato
Copy link
Author

renanliberato commented Jun 15, 2021

Hmm, it seems that IL2CPP does not like generic methods with structs (look the last commet): https://forum.unity.com/threads/any-workaround-for-il2cpp-aot-generic-virtual-methods-and-explicit-interfaces.876664/

I did a mass find/replace on components and component methods replacing structs to classes, and then the build worked.

Still superficial and not the best solution, I think, but at least it is some info =P

@bnoazx005
Copy link
Owner

Thanks for the link, will read this later.

Also I've tried to make a WebGL build with latest version of the library and no errors have happened. Did you use dynamic libraries or just copy sources into your project? Remember that dll with editor's stuffs should be placed in Editor/ directory.

About the solution below: it could be used as temporary hack. For now I suppose to introduce conditional compilation to disable generic methods and replace them with simple arguments.

@renanliberato
Copy link
Author

renanliberato commented Jun 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants