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

Auto warmup not working on IOS build #52

Closed
H-man opened this issue Aug 29, 2020 · 4 comments
Closed

Auto warmup not working on IOS build #52

H-man opened this issue Aug 29, 2020 · 4 comments

Comments

@H-man
Copy link

H-man commented Aug 29, 2020

IOS build crashes at startup with this message:

ExecutionEngineException: Attempting to call method 'Morpeh.TypeIdentifier`1[[MyTestComponent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::Warmup' for which no ahead of time (AOT) code was generated.
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0 
  at Morpeh.WorldExtensions.InitializationDefaultWorld () [0x00000] in <00000000000000000000000000000000>:0 
UnityEngine.UnhandledExceptionHandler:PrintException(String, Exception)
UnityEngine.UnhandledExceptionHandler:HandleUnhandledException(Object, UnhandledExceptionEventArgs)
System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)

I fixed this wrapping these 'warm types' codes in InitializationDefaultWorld method with !UNITY_IOS define. Not sure if this problem exists on other AOT platforms too

@olegmrzv
Copy link
Contributor

olegmrzv commented Sep 4, 2020

@H-man is it develop build or release?

@H-man
Copy link
Author

H-man commented Sep 4, 2020

Release build, stripping level set to 'low' and Script Call Optimization set to 'Fast but no Exceptions'

Not sure what that warm types does, but it works perfectly on IOS without that

@olegmrzv
Copy link
Contributor

olegmrzv commented Sep 5, 2020

It must be work okay.
Warming up is needed only for components that are created through the inspector UniversalProvider or Singleton.
In the latest develop, the exception is replaced with a warning so that the user understands which types are not warmed up.
Typically, types that are not used anywhere in the code are not warmed up.

@H-man
Copy link
Author

H-man commented Sep 5, 2020

Tried today using latest Develop branch and no crashing anymore. I think this issue can be closed now.

@H-man H-man closed this as completed Sep 5, 2020
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