Immediate crash on boot with il2cpp Android

I recently changed from Mono to il2cpp, and now in non-development builds I’m crashing immediately on boot on device.

I get the same issue with Strip Engine Code disabled, or on with stripping level set to Low

I turned on Create Symbols.zip so I could use ndk-stack which produced the following:

 ********** Crash dump: **********
Build fingerprint: 'samsung/gtasliteltecs/gtasliteltecs:10/QP1A.190711.020/T387WVLU3CUG2:user/release-keys'
#00 0x05ed2878 /data/app/com.obfuscated.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  unity_sequence_point_active_entry
                                                                                                  ??:0:0
#01 0x04caae98 /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  MathfInternal__cctor_mC2F676B6F0CC5E10406BB514D669BD196368295F
                                                                                                  ??:0:0
#02 0x05fd7dd8 /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**)
                                                                                                  ??:0:0
#03 0x05fd7c24 /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)
                                                                                                  ??:0:0
#04 0x05fd556c /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  il2cpp::vm::Runtime::ClassInit(Il2CppClass*)
                                                                                                  ??:0:0
#05 0x05fe66e4 /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  il2cpp::vm::MetadataCache::ExecuteEagerStaticClassConstructors()
                                                                                                  ??:0:0
#06 0x05fd6f6c /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  il2cpp::vm::Runtime::Init(char const*)
                                                                                                  ??:0:0
#07 0x05f95c10 /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libil2cpp.so (il2cpp_init+28) (BuildId: 47292852254a16f67789200ce35b850722e094dd)
                                                                                                  il2cpp_init
                                                                                                  ??:0:0
#08 0x001eb75d /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libunity.so (BuildId: 07a14a4f28a1285df9a3d824743065ae4adfc533)
                                                                                                 InitializeIl2CppFromMain(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, int, char const**, bool)
                                                                                                 ??:0:0
#09 0x0023f86f /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libunity.so (BuildId: 07a14a4f28a1285df9a3d824743065ae4adfc533)
                                                                                                 UnityInitApplication()
                                                                                                 ??:0:0
#10 0x0024049b /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libunity.so (BuildId: 07a14a4f28a1285df9a3d824743065ae4adfc533)
                                                                                                 UnityPlayerLoop()
                                                                                                 ??:0:0
#11 0x002526fd /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/lib/arm/libunity.so (BuildId: 07a14a4f28a1285df9a3d824743065ae4adfc533)
                                                                                                 nativeRender(_JNIEnv*, _jobject*)
                                                                                                 ??:0:0
#12 0x000521e3 /data/app/com.obfuscated.1.MyTitle--0UH7zMW69BscsWtedfJCA==/oat/arm/base.odex
Crash dump is completed

I assume il2cpp is unhappy with one of my static classes? Is there a way of figuring out which one?

NB I originally posted this on Answers yesterday, and have since found that Answers was under consideration for being sunsetted and is a lot less active than the forums. I apologize for the duplicate post.

I read through Android builds failing when 'Script Debugging' is enabled and found we were running buildPlayerOptions.options |= BuildOptions.AllowDebugging; for this type of build. Removing that line “fixed” my problem in that it didn’t crash. I did not try increasing the stripping level.

For reference I’m using Unity 2021.3.0f1

It’s still not clear to me what’s happening under the hood, but I’m moving on to other problems.