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

Error when compiling on iOS #16

Closed
intentor opened this issue May 7, 2015 · 5 comments
Closed

Error when compiling on iOS #16

intentor opened this issue May 7, 2015 · 5 comments
Assignees
Labels
Milestone

Comments

@intentor
Copy link
Owner

intentor commented May 7, 2015

When building to iOS, the following error occurs with Adic 2.9:

ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) Adic.InjectionContainer:InjectionContainer ()' while running with --aot-only.

  at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0 
  at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0 
  at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0 
  at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0 
  at Adic.Util.MethodUtils.CreateConstructor (System.Type type, System.Reflection.ConstructorInfo constructor) [0x00000] in <filename unknown>:0 
  at Adic.Cache.ReflectionFactory.Create (System.Type type) [0x00000] in <filename unknown>:0 
  at Adic.Cache.ReflectionCache.Add (System.Type type) [0x00000] in <filename unknown>:0 
  at Adic.Cache.ReflectionCache.GetClass (System.Type type) [0x00000] in <filename unknown>:0 
  at Adic.Injection.Injector.Inject (System.Object instance) [0x00000] in <filename unknown>:0 
  at Adic.Injection.Injector.OnBeforeAddBinding (IBinder source, Adic.Binding.BindingInfo& binding) [0x00000] in <filename unknown>:0 
  at Adic.Binding.Binder.AddBinding (Adic.Binding.BindingInfo binding) [0x00000] in <filename unknown>:0 
  at Adic.Binding.BindingFactory.AddBinding (System.Object value, BindingInstance instanceType) [0x00000] in <filename unknown>:0 
  at Adic.Binding.BindingFactory.To (System.Type type, System.Object instance) [0x00000] in <filename unknown>:0 
  at Adic.Binding.BindingFactory.To[InjectionContainer] (Adic.InjectionContainer instance) [0x00000] in <filename unknown>:0 
  at Adic.InjectionContainer.RegisterItself () [0x00000] in <filename unknown>:0 
  at Adic.InjectionContainer..ctor () [0x00000] in <filename unknown>:0 
  at MastersOfConquest.GameRoot.SetupContainers () [0x00000] in <filename unknown>:0 
  at Adic.ContextRoot.Awake () [0x00000] in <filename unknown>:0 

Using the 2.7 version works fine.

Issue happens on iPhone 6, iOS 8.3.

@intentor intentor added the bug label May 7, 2015
@intentor intentor self-assigned this May 7, 2015
@intentor intentor added this to the v2.10 milestone May 7, 2015
@intentor
Copy link
Owner Author

intentor commented May 7, 2015

The link http://developer.xamarin.com/guides/ios/advanced_topics/limitations/ points out that dynamic code generation is not supported on iOS, which is probably causing the error.

@masterial
Copy link

I am using callbacks to refer to a command from one of my functions in GameController. Seems like 2.9 has some issues with that and 2.7 does not. However, I am not sure exactly if that's the issue.

On May 7, 2015, at 4:57 PM, intentor notifications@github.com wrote:

The link http://developer.xamarin.com/guides/ios/advanced_topics/limitations/ http://developer.xamarin.com/guides/ios/advanced_topics/limitations/ points out that dynamic code generation is not supported on iOS, which is probably causing the error.


Reply to this email directly or view it on GitHub #16 (comment).

@intentor
Copy link
Owner Author

intentor commented May 8, 2015

As far as I can tell, the problem seems to be related to the dynamic code generation (which is not available on iOS) used on the caching system.

I'm looking into ways of achieving the current performance with other techniques rather than direct reflection call.

@intentor
Copy link
Owner Author

intentor commented May 8, 2015

Looks like compiled lambda expressions can run just fine on iOS (http://stackoverflow.com/questions/29245589/why-does-lambdaexpression-compile-work-on-ios-xamarin and http://stackoverflow.com/questions/24977939/what-does-expression-compile-do-on-monotouch). Maybe the solution will be to switch to them.

@intentor
Copy link
Owner Author

intentor commented May 8, 2015

From the Mono docs, even Expression.Compile() seems not to work on iOS builds because of the AOT compilation: http://www.mono-project.com/docs/advanced/aot/.

@intentor intentor changed the title Error when compiling do iOS Error when compiling on iOS Jun 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants