IL2CPP on Standalone fails JIT support detection

poshih 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 4 1 duplicate

I deleted everything and start new project and build a il2cpp standalone build with Net 4.x and API compability 4.x and got this error on game load, used to work last week,

Object References: 

    "declarations": {
        "collection": {
            "$content": [],
            "$version": "A"
        "$version": "A"

UnityEngine.Logger:Log(LogType, Object, Object)
UnityEngine.Debug:LogWarning(Object, Object)
Ludiq.Serialization:DeserializeInto(SerializationData, Object&, Boolean)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Failed to deserialize scriptable object.
System.Runtime.Serialization.SerializationException: Deserialization into 'Bolt.VariablesAsset' failed. ---> System.TypeInitializationException: The type initializer for 'System.Reflection.Emit.DynamicMethod.AnonHostModuleHolder' threw an exception. ---> System.NotSupportedException: C:\Program Files\Unity\Hub\Editor\2018.2.2f1\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\AssemblyBuilder.cpp(20) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Duplicates 1

Working on Fix

Hi poshih,

Sorry you're having this issue.

Using IL2CPP in Standalone is a new feature to 2018.1, and it throws off JIT support detection for Bolt.

I'll modify the detection code and issue a hotfix ASAP.

Fixed in Next Version

A bit hacky fix, but I managed to detect support at runtime with a try catch.

Should work in v.1.4.0f5.