[IL2CPP] Unknown error after upgrade to 2018.1

We tried upgrading our project from 2017.3 to 2018.1 today. After upgrading and fixing some shader upgrade errors, we get an unknown IL2CPP error. We’re using the new 4.x runtime, but the error persists in 3.5. The Mono build of the project is working fine, with both versions of the runtime.

The biggest problem is, the error displayed is an error in the error-displaying code of IL2CPP. So we have no idea which assembly is breaking the build or why. AFAIK the IL2CPP program does not output its internal logs anywhere, so we can’t see what is breaking. The process builds the assemblies, goes through stripping but fails for unknown reasons when trying to generate C++ code.

Error message returned by editor:
https://pastebin.com/raw/yXu14sfz

EDIT:
Further investigation, after decompiling il2cpp reveals this exception being thrown:
https://pastebin.com/raw/jDhuEPAp

Still don’t know which assembly causes this.

EDIT 2:
This is the code that is causing the error:
https://pastebin.com/raw/FfTuB8Mx

Can someone tell me IL2CPP doesn’t accept this in 2018.1?

Thanks for reporting this issue. Indeed, the first error is a problem during the error handling of the actual issue, which is the second error you reported. Both the error handling issue and the actual problem will be corrected in a 2018.1 patch release. I’m not sure if the fixes will make the first patch release, but they should at least in the second.

This issue is triggered by the nullable generic argument “T?” in the code you provided. If possible you can work around the issue by not using a nullable type there.

1 Like

Hi Josh,

Thanks for the fast reply. Wasn’t this alredy fixed in 2017.4.2f2?

Indeed, it was corrected. Unfortunately, that change did not make our cut-off for the initial 2018.1 release. So it needs to wait for a 2018.1 patch release.