yukieiji / UnityExplorer

An in-game UI for exploring, debugging and modifying IL2CPP and Mono Unity games.
GNU General Public License v3.0
202 stars 14 forks source link

[Bug]: Method not found: 'Void UnityEngine.WaitForEndOfFrame..ctor()'. #20

Closed discus-sions closed 3 weeks ago

discus-sions commented 3 weeks ago

Are you on the latest version of UnityExplorer?

Which release are you using?

BepInEx IL2CPP CoreCLR

Which game did this occur on?

Papers Please

Describe the issue.

Pretty sure this is just an issue with how old this game is. (2020 unity version). This game also doesn't use any of UnityEngine's built in UI, so I had to add the UnityEngine.UI dll to the BepInEx/interop folder to get UnityExplorer to not error on load.

Relevant log output

[Message: Preloader] BepInEx 6.0.0-be.697 - PapersPlease
[Message: Preloader] Built from commit 53625800b86f6c68751445248260edf0b27a71c2
[Info   :   BepInEx] System platform: Windows 10 64-bit
[Info   :   BepInEx] Process bitness: 64-bit (x64)
[Info   :   BepInEx] Running under Unity 2020.3.34f1
[Info   :   BepInEx] Runtime version: 6.0.7
[Info   :   BepInEx] Runtime information: .NET 6.0.7
[Info   : Preloader] 0 patcher plugins loaded
[Info   : Preloader] 0 assemblies discovered
[Message:AssemblyPatcher] Executing 0 patch(es)
[Message:   BepInEx] Chainloader initialized
[Info   :Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[Info   :   BepInEx] 1 plugin to load
[Info   :   BepInEx] Loading [UnityExplorer 4.12.1]
[Message:UnityExplorer] UnityExplorer 4.12.1 initializing...
[Message:UnityExplorer] [UniverseLib] UniverseLib 1.5.6 initializing...
[Info   :Il2CppInterop] Registered mono type UniverseLib.UniversalBehaviour in il2cpp domain
[Info   :Il2CppInterop] Registered mono type UniverseLib.Runtime.Il2Cpp.Il2CppManagedEnumerator in il2cpp domain
[Message:UnityExplorer] [UniverseLib] Finished UniverseLib initial setup.
[Info   :Il2CppInterop] Registered mono type UnityExplorer.ExplorerBehaviour in il2cpp domain
[Message:UnityExplorer] Initialized UnityCrashPrevention for: Canvas.get_renderingDisplaySize
[Message:   BepInEx] Chainloader startup complete
[Message:UnityExplorer] [UniverseLib] Can't cache type named DragState Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.BaseField`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.TypedUxmlAttributeDescription`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.TypedUxmlAttributeDescription`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.TypedUxmlAttributeDescription`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.TypedUxmlAttributeDescription`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.TypedUxmlAttributeDescription`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.TypedUxmlAttributeDescription`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.TypedUxmlAttributeDescription`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.UIR.ShaderInfoStorage`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.UIR.ShaderInfoStorage`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.UIR.LinkedPool`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Can't cache type named <>c Error: System.TypeLoadException: Could not load type 'UnityEngine.UIElements.UIR.LinkedPool`1' from assembly 'UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.RuntimeTypeCache.GetEnclosingType()
   at System.RuntimeType.RuntimeTypeCache.GetNameSpace()
   at System.RuntimeType.get_Namespace()
   at UniverseLib.ReflectionUtility.CacheTypes(Assembly asm) in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Reflection\ReflectionUtility.cs:line 121
[Message:UnityExplorer] [UniverseLib] Loaded Unhollowed modules in 5.709 seconds.
[Message:UnityExplorer] [UniverseLib] Setup deobfuscation cache in 0.29000002 seconds.
[Message:UnityExplorer] [UniverseLib] Initialized Legacy Input support
[Error  :Il2CppInterop] Exception in IL2CPP-to-Managed trampoline, not passing it to il2cpp: System.TypeInitializationException: The type initializer for 'UniverseLib.Input.CursorUnlocker' threw an exception.
 ---> System.MissingMethodException: Method not found: 'Void UnityEngine.WaitForEndOfFrame..ctor()'.
   at UniverseLib.Input.CursorUnlocker..cctor()
   --- End of inner exception stack trace ---
   at UniverseLib.Input.CursorUnlocker.Init() in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Input\CursorUnlocker.cs:line 38
   at UniverseLib.Input.InputManager.Init() in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Input\InputManager.cs:line 29
   at UniverseLib.Universe.SetupCoroutine()+MoveNext() in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Universe.cs:line 129
   at UniverseLib.Runtime.Il2Cpp.Il2CppManagedEnumerator.MoveNext() in F:\Documents\VisualStudioProject\AmongUs\UnityExplorer\UniverseLib\src\Runtime\Il2Cpp\Il2CppManagedEnumerator.cs:line 80
   at Trampoline_ByteThisUniverseLib.Runtime.Il2Cpp.Il2CppManagedEnumeratorMoveNext(IntPtr , Il2CppMethodInfo* )
discus-sions commented 3 weeks ago

for context here is that ui message i was talking about (this is after running bepinex for the first time)

[Error  :   BepInEx] Error loading [UnityExplorer 4.12.1]: System.IO.FileNotFoundException: Could not load file or assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at UniverseLib.Universe.Init(Single startupDelay, Action onInitialized, Action`2 logHandler, UniverseLibConfig config)
   at UnityExplorer.ExplorerCore.Init(IExplorerLoader loader)
   at UnityExplorer.ExplorerBepInPlugin.Init()
   at UnityExplorer.ExplorerBepInPlugin.Load()
   at BepInEx.Unity.IL2CPP.IL2CPPChainloader.LoadPlugin(PluginInfo pluginInfo, Assembly pluginAssembly) in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/IL2CPPChainloader.cs:line 134
   at BepInEx.Bootstrap.BaseChainloader`1.LoadPlugins(IList`1 plugins) in /home/runner/work/BepInEx/BepInEx/BepInEx.Core/Bootstrap/BaseChainloader.cs:line 411
yukieiji commented 3 weeks ago

This isn't a bug(Nor is it due to old Unity.). Unity's Il2Cpp has a setting to exclude unnecessary code when building a game, and if this is the case, DLLs and other code required by UE may not be present in the game and may not work.

discus-sions commented 3 weeks ago

Okay, thanks for asnwering. So is there nothing I can do? I should just close this now?

yukieiji commented 3 weeks ago

Yes, even I can't help you. I'll close this ticket.