Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to generate Il2Cpp interop assemblies ---> System.Exception: Failed to find pCodegenModules #798

Open
EddyTheAnimator1 opened this issue Mar 12, 2024 · 0 comments
Labels
error Error message or log that may need investigation needs-replication Issue needs to be replicated by BepInEx dev

Comments

@EddyTheAnimator1
Copy link

What happened?

I kept getting the error

File name: 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
at BepInEx.Unity.IL2CPP.IL2CPPChainloader.OnInvokeMethod(IntPtr method, IntPtr obj, IntPtr parameters, IntPtr exc)

Which i simply fixed by copying UnityEngine.CoreModule.dll into the core folder.
(This CoreModule error was a crash error. Without doing this would result in the game just not opening)

Then configured BepInEx.cfg UnityLogListening = false since i kept getting the Chainloader error

The Chainloader error was
[Fatal : BepInEx] Unable to execute IL2CPP chainloader
[Error : BepInEx] System.MissingMethodException: Method not found: 'LogCallback LogCallback.op_Implicit(System.Action3<System.String,System.String,UnityEngine.LogType>)'. at BepInEx.Unity.IL2CPP.Logging.IL2CPPUnityLogSource..ctor() at BepInEx.Unity.IL2CPP.IL2CPPChainloader.OnInvokeMethod(IntPtr method, IntPtr obj, IntPtr parameters, IntPtr exc) in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/IL2CPPChainloader.cs:line 88 [Fatal : BepInEx] Unable to execute IL2CPP chainloader [Error : BepInEx] System.MissingMethodException: Method not found: 'LogCallback LogCallback.op_Implicit(System.Action3<System.String,System.String,UnityEngine.LogType>)'.
at BepInEx.Unity.IL2CPP.Logging.IL2CPPUnityLogSource..ctor()
at BepInEx.Unity.IL2CPP.IL2CPPChainloader.OnInvokeMethod(IntPtr method, IntPtr obj, IntPtr parameters, IntPtr exc) in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/IL2CPPChainloader.cs:line 104

But after doing these changes. I now get a error that i cant quite fix.

Also the unityexplorer plugin doesnt seem to load at all. Not even showing 1 plugins to load in the log (This is definitely on my behalf though.)

BepInEx Distribution

Bleeding Edge from BepisBuilds

Log outputs

[Message: Preloader] BepInEx 6.0.0-be.688 - horizon
[Message: Preloader] Built from commit 49015217f3becf052d33fa4658ac19229f5daa3a
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   :   BepInEx] Running under Unity 2021.3.33f1
[Info   :   BepInEx] Runtime version: 6.0.7
[Info   :   BepInEx] Runtime information: .NET 6.0.7
[Message:InteropManager] Downloading unity base libraries
[Message:InteropManager] Extracting downloaded unity base libraries
[Message:InteropManager] Running Cpp2IL to generate dummy assemblies
[Info   :    Cpp2IL] [Library] Initializing Metadata...
[Info   :    Cpp2IL] [Library] Using actual IL2CPP Metadata version 29
[Info   :    Cpp2IL] [Library] Initialized Metadata in 656ms
[Info   :    Cpp2IL] [Library] Using binary type Portable Executable (from LibCpp2IL)
[Info   :    Cpp2IL] [Library] Searching Binary for Required Data...
[Error  :InteropManager] Failed to generate Il2Cpp interop assemblies: Cpp2IL.Core.Exceptions.LibCpp2ILInitializationException: Fatal Exception initializing LibCpp2IL!
 ---> System.Exception: Failed to find pCodegenModules
   at LibCpp2IL.BinarySearcher.FindCodeRegistrationPost2019() in /home/runner/work/Cpp2IL/Cpp2IL/LibCpp2IL/BinarySearcher.cs:line 193
   at LibCpp2IL.Il2CppBinary.FindCodeAndMetadataReg(Int32 methodCount, Int32 typeDefinitionsCount) in /home/runner/work/Cpp2IL/Cpp2IL/LibCpp2IL/Il2CppBinary.cs:line 450
   at LibCpp2IL.LibCpp2IlBinaryRegistry.CreateAndInit(Byte[] buffer, Il2CppMetadata metadata) in /home/runner/work/Cpp2IL/Cpp2IL/LibCpp2IL/LibCpp2IlBinaryRegistry.cs:line 68
   at LibCpp2IL.LibCpp2IlMain.Initialize(Byte[] binaryBytes, Byte[] metadataBytes, UnityVersion unityVersion) in /home/runner/work/Cpp2IL/Cpp2IL/LibCpp2IL/LibCpp2IlMain.cs:line 159
   at LibCpp2IL.LibCpp2IlMain.LoadFromFile(String pePath, String metadataPath, UnityVersion unityVersion) in /home/runner/work/Cpp2IL/Cpp2IL/LibCpp2IL/LibCpp2IlMain.cs:line 203
   at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il(String assemblyPath, String metadataPath, UnityVersion unityVersion, Boolean allowUserToInputAddresses) in /_/Cpp2IL.Core/Cpp2IlApi.cs:line 61
   --- End of inner exception stack trace ---
   at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il(String assemblyPath, String metadataPath, UnityVersion unityVersion, Boolean allowUserToInputAddresses) in /_/Cpp2IL.Core/Cpp2IlApi.cs:line 67
   at BepInEx.Unity.IL2CPP.Il2CppInteropManager.RunCpp2Il() in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/Il2CppInteropManager.cs:line 301
   at BepInEx.Unity.IL2CPP.Il2CppInteropManager.GenerateInteropAssemblies() in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/Il2CppInteropManager.cs:line 236
[Info   : Preloader] 0 patcher plugins loaded
[Info   : Preloader] 0 assemblies discovered
[Message:AssemblyPatcher] Executing 0 patch(es)
[Message:   BepInEx] Chainloader initialized
[Info   :   BepInEx] 0 plugins to load
[Message:   BepInEx] Chainloader startup complete

Environment

- OS: Windows 10 Home
- BepInEx: 6.0.0-be.688
- Game: Meta Horizon Worlds
@EddyTheAnimator1 EddyTheAnimator1 added error Error message or log that may need investigation needs-replication Issue needs to be replicated by BepInEx dev labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error Error message or log that may need investigation needs-replication Issue needs to be replicated by BepInEx dev
Projects
None yet
Development

No branches or pull requests

1 participant