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

Hello,

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

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?

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.

Yeah, I know about the planned full generic sharing (I asked about it few weeks ago - x.com); I guess there’s not timeframe for that yet, right? :frowning:

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? :slight_smile:

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?

Made a simple demo, should be uploaded as a case 1025354.

1 Like