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

Solves AOT compilation issue for Unity - iOS #388

Closed
wants to merge 1 commit into from

Conversation

rgarat
Copy link
Contributor

@rgarat rgarat commented May 14, 2015

When using protobuf c# in unity for building iOS there is an issue with AOT compilation

---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Collections.Generic.EqualityComparer1 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ExecutionEngineException: Attempting to JIT compile method 'System.Collections.Generic.GenericEqualityComparer1<Google.ProtocolBuffers.ExtensionRegistry/ExtensionIntPair>:.ctor ()' while running with --aot-only.

The solution is to provide a concrete implementation of IEqualityComparer to avoid AOT compilation.

More references for this issue:
http://stackoverflow.com/questions/24368929/exception-attempting-to-jit-compile-method-while-running-with-aot-only-with
https://code.google.com/p/protobuf-csharp-port/issues/detail?id=98

…ExtensionRegistryLite.cs to prevent AOT compilation issue with unity in iOS
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@rgarat
Copy link
Contributor Author

rgarat commented May 14, 2015

cia: I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@jtattermusch
Copy link
Contributor

Hi, thanks for the pull request. We've already merged all the C# code into the master branch, so it would be great if you can re-create this pull request against master branch.

I will close this PR now to be able to delete the csharp branch.

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

Successfully merging this pull request may close these issues.

None yet

3 participants