il2cppcore.dll did not run properly!

I'm using 2019.4.40f1 to run naninovel. Works perfect in editor. Then when i try to build out on webGL i get this error message. Please help. Anyone know how to fix this?

Exception: /Applications/Unity/Hub/Editor/2019.4.40f1/Unity.app/Contents/il2cpp/build/deploy/il2cppcore/il2cppcore.dll did not run properly!
Failed running "/Applications/Unity/Hub/Editor/2019.4.40f1/Unity.app/Contents/il2cpp/build/deploy/il2cppcore/il2cppcore.dll" --convert-to-cpp --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WebGL" --architecture="EmscriptenJavaScript" --configuration="Release" --outputpath="/Users/novlerogers/My project/Visit the Island/Assets /../Temp/StagingArea/Data/Native/build.bc" --cachedirectory="/Users/novlerogers/My project/Visit the Island/Assets/../Library/il2cpp_cache" --compiler-flags="-Oz -DIL2CPP_EXCEPTION_DISABLED=1 " --emit-method-map --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_AIModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_AccessibilityModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_AndroidJNIModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_AnimationModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_AssetBundleModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_AudioModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_ClothModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_CoreModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_CrashReportingModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_DSPGraphModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_DirectorModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_GameCenterModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_GridModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_HotReloadModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_IMGUIModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_ImageConversionModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_InputLegacyModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_InputModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_JSONSerializeModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_LocalizationModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_ParticleSystemModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_PerformanceReportingModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_Physics2DModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_PhysicsModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_ProfilerModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_ScreenCaptureModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_SharedInternalsModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_SpriteMaskModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_SpriteShapeModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_StreamingModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_SubstanceModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_SubsystemsModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TLSModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TerrainModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TerrainPhysicsModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TextCoreModule_Dynamic.bc"
--additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TerrainPhysicsModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TextCoreModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TextRenderingModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_TilemapModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UIElementsModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UIModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UNETModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UmbraModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityAnalyticsModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityConnectModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityTestProtocolModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityWebRequestAssetBundleModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityWebRequestAudioModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityWebRequestModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityWebRequestTextureModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_UnityWebRequestWWWModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_VFXModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_VRModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_VehiclesModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_VideoModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_WebGLModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_WindModule_Dynamic.bc" --additional-libraries="/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/WebGLSupport/BuildTools/lib/modules/WebGLSupport_XRModule_Dynamic.bc" --profiler-report --map-file-parser="/Applications/Unity/Hub/Editor/2019.4.40f1/Unity.app/Contents/Tools/MapFileParser/MapFileParser" --directory="/Users/novlerogers/My project/Visit the Island/Temp/StagingArea/Data/Managed" --generatedcppdir="/Users/novlerogers/My project/Visit the Island/Temp/StagingArea/Data/il2cppOutput"
stdout:
Building build.bc with EmscriptenToolChain
Output directory: /Users/novlerogers/My project/Visit the Island/Temp/StagingArea/Data/Native
Cache directory: /Users/novlerogers/My project/Visit the Island/Library/il2cpp_cache
il2cpp.exe didn't catch exception: System.AggregateException: One or more errors occurred. (No such file or directory) (No such file or directory) (No such file or directory) (No such file or directory) (No such file or directory) (No such file or directory) (No such file or directory) (No such file or directory) ---> System.ComponentModel.Win32Exception: No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[ ] argv, String[ ] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
at Unity.IL2CPP.Building.ParallelFor.<>c_DisplayClass1_0`2.b0(Object o)
--- End of inner exception stack trace ---
at Unity.IL2CPP.Building.ParallelFor.RunWithResultD,T
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
at il2cpp.Program.DoRun(String[ ] args, List
1 foundAssemblies)
at il2cpp.Program.Run(String[ ] args, Boolean setInvariantCulture)
at il2cpp.Program.Main(String[ ] args)
---> (Inner Exception #0) System.ComponentModel.Win32Exception (2): No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[ ] argv, String[ ] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
at Unity.IL2CPP.Building.ParallelFor.<>c
DisplayClass1_0`2.b0(Object o)<---
---> (Inner Exception #1) System.ComponentModel.Win32Exception (2): No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[ ] argv, String[ ] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
at Unity.IL2CPP.Building.ParallelFor.<>c
DisplayClass1_0`2.b0(Object o)<---
---> (Inner Exception #2) System.ComponentModel.Win32Exception (2): No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[ ] argv, String[ ] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
at Unity.IL2CPP.Building.ParallelFor.<>c
DisplayClass1_0`2.b0(Object o)<---
--> (Inner Exception #3) System.ComponentModel.Win32Exception (2): No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[ ] argv, String[ ] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
at Unity.IL2CPP.Building.ParallelFor.<>c
DisplayClass1_0`2.b0(Object o)<---
---> (Inner Exception #4) System.ComponentModel.Win32Exception (2): No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[ ] argv, String[ ] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
at Unity.IL2CPP.Building.ParallelFor.<>c
DisplayClass1_0`2.b_0(Object o)<---
---> (Inner Exception #5) System.ComponentModel.Win32Exception (2): No such file or directory
at Interop.Sys.ForkAndExecProcess(String filename, String[ ] argv, String[ ] envp, String cwd, Boolean redirectStdin, Bo

I'm using the same version, 2019.4.40f1. On MacOS 12.5.1 and I cannot build for WebGL. The error is the same. No idea how to fix this.

The issue here is that in 2019.4, we were using an old Emscripten version which used Python 2.7, that was installed in macOS. Last year-ish, Apple removed Python 2.7 from macOS 12.3. and unfortunately we were unable to package it up for 2019.4, but we did for 2020. Unity 2021.3+ uses Emscripten 2, which uses Python 3, so this issue won't occur in those versions, either.

The solution here is:
1. install Python 2.7 from http://www.python.org/
2. manually set the EMSDK_PYTHON environment variable to point to its location. A good way of doing this is to create (or append to) your ~/.zprofile file the following line:
export EMSDK_PYTHON=/usr/local/bin/python2
3. reload the Unity Editor.

Sorry to necro this thread, but this is the first result to come up when I searched this error which I encountered this am running 2019.4.40 on a newish MBP running OS 14.5 Sonoma, and the instructions above did not work.

For me, to get the build to work, I had to take the additional step of creating this file:

#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
public class PreBuildProcessing : IPreprocessBuildWithReport
{
    public int callbackOrder => 1;
    public void OnPreprocessBuild(BuildReport report)
    {
        System.Environment.SetEnvironmentVariable("EMSDK_PYTHON", "/Library/Frameworks/Python.framework/Versions/2.7/bin/python");
    }
}
#endif

Which is saved at Assets/Editor/PreBuildProcessing.cs

See this thread for details