AOT Compilation fails

Hi!

I´m trying to build my current project for iPhone and I´m getting the following error:

Error building Player: UnityException: Cross compilation failed.

Cross compilation job Assembly-CSharp.dll failed.
UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/mono-xcompiler --debug --aot=full,asmonly,write-symbols,soft-debug,static,outfile="Assembly-CSharp.dll.s" "Assembly-CSharp.dll"  current dir : <ProjectFolder>/Temp/StagingArea/Data/Managed
 result file exists: False
stdout: Mono Ahead of Time compiler - compiling assembly <ProjectFolder>/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll* Assertion at method-to-ir.c:2651, condition `method->is_inflated  mono_method_get_context (method)->method_inst' not met
stderr: 

  at UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile) [0x00000] in <filename unknown>:0 
  at UnityEditor.MonoCrossCompile.CrossCompileAOT (BuildTarget target, System.String crossCompilerAbsolutePath, System.String assembliesAbsoluteDirectory, CrossCompileOptions crossCompileOptions, System.String input, System.String output, System.String additionalOptions) [0x00000] in <filename unknown>:0 
  at UnityEditor.MonoCrossCompile+JobCompileAOT.ThreadPoolCallback (System.Object threadContext) [0x00000] in <filename unknown>:0 
UnityEditor.MonoCrossCompile:CrossCompileAOTDirectoryParallel(BuildTarget, CrossCompileOptions, String, String, String)
PostProcessiPhonePlayer:PostProcess(BuildTarget, String, String, String, String, String, String, String, BuildOptions, RuntimeClassRegistry)
UnityEditor.HostView:OnGUI()

There must be something I´m doing in my code that I must not be doing in order to compile using AOT, but I have to clue of where to start, even after searching the web, and reading a lot of documentation, I can´t find the response to the issue:

Assertion at
method-to-ir.c:2651,
condition `method->is_inflated  mono_method_get_context (method)->method_inst' not met

The compiler does not hint where the error is:

 at UnityEditor.MonoProcessUtility.RunMonoProcess (...) [0x00000] in <filename unknown>:0

Do you know where can I find information about the best practices and what not to do, in order to support AOT compilation?

Thanks in advance.

Edited:
I found the problem.

Hi! I have the same problem but I couldnt find any solution. I will be pleased if you help me.
Thank you.