LavaGang / MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
https://discord.gg/2Wn3N2P
Apache License 2.0
2.48k stars 479 forks source link

[Bug]: UnityEngine.Texture::GetDataWidth not resolved #452

Closed CanYing0913 closed 1 month ago

CanYing0913 commented 1 year ago

All of the following criteria must be met

All of the following are optional to answer

Describe the issue.

Latest.log I am trying to play MellonLoader with a small game. However, I encountered the following error without any pointers to interpret. After the messages shown in the log, the game starts with a black screen and then quits immediately.

[18:16:33.674] [MelonStartScreen] Exception while init rendering: System.TypeInitializationException: The type initializer for 'MelonUnityEngine.Texture' threw an exception.
 ---> System.Exception: ICall UnityEngine.Texture::GetDataWidth not resolved
   at UnhollowerMini.UnityInternals.ResolveICall(String signature) in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UnhollowerMini\UnityInternals.cs:line 278
   at UnhollowerMini.UnityInternals.ResolveICall[T](String signature) in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UnhollowerMini\UnityInternals.cs:line 287
   at MelonUnityEngine.Texture..cctor() in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UnityEngine\CoreModule\Texture.cs:line 24
   --- End of inner exception stack trace ---
   at MelonUnityEngine.Texture..ctor(IntPtr ptr) in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UnityEngine\CoreModule\Texture.cs:line 35
   at MelonUnityEngine.Texture2D..ctor(Int32 width, Int32 height) in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UnityEngine\CoreModule\Texture2D.cs:line 56
   at MelonLoader.MelonStartScreen.UI.UI_Utils.CreateColorTexture(Color color) in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UI\UI_Utils.cs:line 11
   at MelonLoader.MelonStartScreen.UI.Objects.UI_Background..ctor(cBackground backgroundSettings) in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UI\Objects\UI_Background.cs:line 16
   at MelonLoader.MelonStartScreen.UI.UI_Style.Init() in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\UI\UI_Style.cs:line 16
   at MelonLoader.MelonStartScreen.ScreenRenderer.Init() in D:\a\MelonLoader\MelonLoader\Dependencies\MelonStartScreen\ScreenRenderer.cs:line 38

Did you attach your log file?

RinLovesYou commented 1 year ago

The start screen isn't required, can you launch with --melonloader.disablestartscreen?

CanYing0913 commented 1 year ago

The start screen isn't required, can you launch with --melonloader.disablestartscreen?

Hi thank you for your help. May I know how can I launch it with arguments? Currently the way I launch it is simply launching the game via shortcut.

AlphaLovesYou commented 1 year ago

The start screen isn't required, can you launch with --melonloader.disablestartscreen?

Hi thank you for your help. May I know how can I launch it with arguments? Currently the way I launch it is simply launching the game via shortcut.

if your game is on steam right click the game on steam and open "properties" and past "--melonloader.disablestartscreen" into the box with the label "Advanced users may choose to enter modifications to their launch options"

if your game is not on steam find the EXE for the game and create a shortcut. right click that shortcut and open "properties" under the shortcut tab add the launch argument to the end of the exe in the "target" field.

CanYing0913 commented 1 year ago

Here is the log I run with --melonloader.disablestartscreen: Latest.log.

rakosi2 commented 1 year ago

same issue as #433 and #437