Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Windows IL2CPP - No AOT code was generated - possible to show the type in the error?

Discussion in 'Experimental Scripting Previews' started by pavelkouril, Apr 12, 2018.

  1. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    Hello,

    I've been trying to port a game to IL2CPP, but I'm getting a lots of the "classic" AOT error for generics.

    Code (CSharp):
    1. ExecutionEngineException: Attempting to call method 'JsonReader::MakeReader' for which no ahead of time (AOT) code was generated.
    The JsonReader::MakeReader is a code that accepts generics, so I know I need to make the dummy calls for IL2CPP to generate the intended code. However, this gets really really cumbersome in stuff like custom deserializer that calls these methods on tons of value types.

    One simple change, adding the generic parameter of the method, would help so much in creating the dummy calls. Would it be possible to do such change?
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,921
    We are working on implementing generalized generic sharing for value types in IL2CPP. Once that is complete, many cases like this will be handled. Unfortunately this implementation is not trivial, so you'll need to manually work around these issues now.
     
  3. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    Yeah, I know about the planned full generic sharing (I asked about it few weeks ago - https://twitter.com/jon_cham/status/977968977224830979); I guess there's not timeframe for that yet, right? :(

    However, yes, in the meantime I'm trying to the manual workarounds - therefore, being able to at least see what types I'm missing would be really really helpful (and I guess would be helpful even in future if you decide to keep it as a optional feature due to the speed implications of full generic sharing); or is that simply not possible/worth the effort, to show the generic parameters in the error as well? :)
     
    Last edited: Apr 12, 2018
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,921
    Sorry, I misunderstood your question. We probably can improve that error message. Can you submit a bug report with a project that causes this issue?
     
  5. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    Made a simple demo, should be uploaded as a case 1025354.
     
    JoshPeterson likes this.