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

[Bug]: libunity.so stripping breaking games #8

Open
6 tasks
TrevTV opened this issue Jan 6, 2023 · 9 comments
Open
6 tasks

[Bug]: libunity.so stripping breaking games #8

TrevTV opened this issue Jan 6, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@TrevTV
Copy link
Member

TrevTV commented Jan 6, 2023

All of the following criteria must be met

  • Full Latest.log file included. If no file exists then leave this unchecked and state so.

All of the following are optional to answer

  • Tried reinstalling the game.
  • Tried reinstalling LemonLoader.
  • Tried restarting device.

Describe the issue.

Replacing libunity.so with the one from the Unity deps repo can sometimes lead to stripping errors that break the game. Not replacing the file leads to constant errors.

Honestly, I have no idea how this part works and what I would need to do to solve it, so I wouldn't expect anything anytime soon.

Known Effected Games:

  • Diversion

Did you attach your log file?

  • Yes, I attached my log file to the text box above.
  • No, I could not find a log file at /storage/emulated/0/Android/data/<package name>/files/melonloader/etc/Latest.log
@TrevTV TrevTV added the bug Something isn't working label Jan 6, 2023
@lrutjens
Copy link

lrutjens commented Apr 12, 2023

the same issue happens with Gods of gravity on the quest 2 on and before v51, these logs are a bit old becuase i've deleted my newer ones but its still the same issue. I'll upload newer logs when i get the chance

Latest.log

@lrutjens
Copy link

this does work on versions of the game that were compilied with no stripping though

@Pietrodjaowjao
Copy link

@TrevTV
How can this be fixed? By disabling 'Strip Engine Code' option in the project or by changing the stripping level?

@TrevTV
Copy link
Member Author

TrevTV commented Oct 5, 2024

@TrevTV
How can this be fixed? By disabling 'Strip Engine Code' option in the project or by changing the stripping level?

I haven't messed with Unity-project-side stuff too much with this, but I believe disabling Strip Engine Code would fix it.

@amir16yp
Copy link

having the same issue in Dictators: No Peace :^(

[19:53:28.718] Initialized JNI
[19:53:29.015] ------------------------------
[19:53:29.017] MelonLoader v0.6.5 Open-Beta
[19:53:29.021] OS: Android 14
[19:53:29.021] Hash Code: 5CD70450DB040884645CC87694335EB2DEFBB8CE840FC149EED709EAD3D2B03F
[19:53:29.021] ------------------------------
[19:53:29.021] Game Type: Il2cpp
[19:53:29.022] Game Arch: x64
[19:53:29.022] ------------------------------
[19:53:29.023] Command-Line: 
[19:53:29.024] ------------------------------
[19:53:29.024] Core::BasePath = /storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators
[19:53:29.025] Game::BasePath = /storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators
[19:53:29.025] Game::DataPath = bin/Data/
[19:53:29.026] Game::ApplicationPath = /system/bin/app_process64
[19:53:29.026] Runtime Type: net8
[19:53:29.580] ------------------------------
[19:53:29.580] Game Name: Dictators:No Peace
[19:53:29.581] Game Developer: AarJeeBee
[19:53:29.590] Unity Version: 2022.3.41f1
[19:53:29.590] Game Version: 59
[19:53:29.591] ------------------------------

[19:53:30.759] DotnetAssemblyLoadContextFix Exception: System.NullReferenceException: Null method for MelonLoader
   at HarmonyLib.PatchProcessor.Patch()
   at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer, HarmonyMethod ilmanipulator)
   at MelonLoader.Fixes.DotnetAssemblyLoadContextFix.Install()
[19:53:31.277] HarmonyLib.HarmonyException: IL Compile Error (unknown location)
 ---> HarmonyLib.HarmonyException: IL Compile Error (unknown location)
 ---> System.MissingMethodException: Method not found: void Il2CppInterop.Runtime.Injection.RegisterTypeOptions.set_LogSuccess(bool)
   at System.RuntimeMethodHandle.GetFunctionPointer()
   at MonoMod.Core.Platforms.Runtimes.MonoRuntime.Compile(MethodBase method)
   at MonoMod.Core.Platforms.PlatformTriple.Compile(MethodBase method)
   at MonoMod.RuntimeDetour.DetourManager.ManagedDetourState.UpdateEndOfChain()
   at MonoMod.RuntimeDetour.DetourManager.ManagedDetourState.AddILHook(SingleILHookState ilhook, Boolean takeLock)
   at MonoMod.RuntimeDetour.ILHook.Apply()
   at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo(MethodBase replacement)
   --- End of inner exception stack trace ---
   at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo(MethodBase replacement)
   at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
   --- End of inner exception stack trace ---
   at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
   at HarmonyLib.PatchProcessor.Patch()
   at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer, HarmonyMethod ilmanipulator)
   at MelonLoader.Fixes.Il2CppInteropFixes.Install()
[19:53:31.509] Preferences Loaded!

[19:53:31.680] Loading UserLibs from '/storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators/UserLibs'...

[19:53:31.688] Loading Plugins from '/storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators/Plugins'...
[19:53:31.695] 0 Plugins loaded.
[19:53:32.015] Loading Il2CppAssemblyGenerator...
[19:53:32.099] [Il2CppAssemblyGenerator] Contacting RemoteAPI...
[19:53:33.241] [Il2CppAssemblyGenerator] Game Not Found on RemoteAPI Host (https://api.melonloader.com/api/v1/game/dictators-no-peace)
[19:53:33.241] [Il2CppAssemblyGenerator] RemoteAPI.DumperVersion = null
[19:53:33.241] [Il2CppAssemblyGenerator] RemoteAPI.ObfuscationRegex = null
[19:53:33.241] [Il2CppAssemblyGenerator] RemoteAPI.MappingURL = null
[19:53:33.241] [Il2CppAssemblyGenerator] RemoteAPI.MappingFileSHA512 = null
[19:53:33.259] [Il2CppAssemblyGenerator] Using Cpp2IL Version: 2022.1.0-pre-release.16
[19:53:33.259] [Il2CppAssemblyGenerator] Using Il2CppInterop Version = 1.4.6+5c0c44bfc31bc50023fb7426fc4a32b2086f672b
[19:53:33.259] [Il2CppAssemblyGenerator] Using Unity Dependencies Version = 2022.3.41
[19:53:33.259] [Il2CppAssemblyGenerator] Using Deobfuscation Regex = null
[19:53:33.260] [Il2CppAssemblyGenerator] UnityDependencies is up to date.
[19:53:33.260] [Il2CppAssemblyGenerator] Checking GameAssembly...
[19:53:33.409] [Il2CppAssemblyGenerator] Assembly is up to date. No Generation Needed.

[19:53:33.411] Loading Mods from '/storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators/Mods'...
[19:53:33.412] ------------------------------
[19:53:33.419] Melon Assembly loaded: './Mods/TestMelonMod.dll'
[19:53:33.419] SHA256 Hash: 'AF9A6C4537AD817C8401BEE4CDA46D25CD755A2C6DFE81C07DECCFB504F5CD23'

[19:53:33.538] ------------------------------
[19:53:33.540] testmod for dictators no peace v1.0
[19:53:33.540] by amir16yp
[19:53:33.541] Assembly: TestMelonMod.dll
[19:53:33.542] ------------------------------
[19:53:33.542] ------------------------------
[19:53:33.542] 1 Mod loaded.

[19:53:33.963] SceneManager.sceneLoaded override failed: System.TypeInitializationException: The type initializer for 'Il2CppInterop.Runtime.Injection.InjectorHelpers' threw an exception.
 ---> System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
   at System.Linq.Enumerable.TryGetSingle[ProcessModule](IEnumerable`1 source, Func`2 predicate, Boolean& found)
   at System.Linq.Enumerable.Single[ProcessModule](IEnumerable`1 source, Func`2 predicate)
   at Il2CppInterop.Runtime.Injection.InjectorHelpers..cctor()
   --- End of inner exception stack trace ---
   at Il2CppInterop.Runtime.Injection.ClassInjector.RegisterTypeInIl2Cpp(Type type)
   at Il2CppInterop.Runtime.Injection.ClassInjector.RegisterTypeInIl2Cpp[Il2CppToMonoDelegateReference]()
   at Il2CppInterop.Runtime.DelegateSupport.ConvertDelegate[UnityAction`2](Delegate delegate)
   at UnityEngine.Events.UnityAction`2[[UnityEngine.SceneManagement.Scene, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[UnityEngine.SceneManagement.LoadSceneMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].op_Implicit(Action`2 )
   at MelonLoader.Support.SceneHandler.Init()
[19:53:33.967] SceneManager.sceneUnloaded override failed: System.TypeInitializationException: The type initializer for 'Il2CppInterop.Runtime.Injection.InjectorHelpers' threw an exception.
 ---> System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
   at System.Linq.Enumerable.TryGetSingle[ProcessModule](IEnumerable`1 source, Func`2 predicate, Boolean& found)
   at System.Linq.Enumerable.Single[ProcessModule](IEnumerable`1 source, Func`2 predicate)
   at Il2CppInterop.Runtime.Injection.InjectorHelpers..cctor()
   --- End of inner exception stack trace ---
   at Il2CppInterop.Runtime.Injection.ClassInjector.RegisterTypeInIl2Cpp(Type type)
   at Il2CppInterop.Runtime.Injection.ClassInjector.RegisterTypeInIl2Cpp[Il2CppToMonoDelegateReference]()
   at Il2CppInterop.Runtime.DelegateSupport.ConvertDelegate[UnityAction`1](Delegate delegate)
   at UnityEngine.Events.UnityAction`1[[UnityEngine.SceneManagement.Scene, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].op_Implicit(Action`1 )
   at MelonLoader.Support.SceneHandler.Init()
[19:53:33.976] No Support Module Loaded!

@TrevTV
Copy link
Member Author

TrevTV commented Oct 19, 2024

@amir16yp That doesn't look like a stripping issue, that looks like the initial issue that Muse Dash had. If you replace the Il2CppInterop.Runtime.dll in /sdcard/MelonLoader/{package}/MelonLoader/net8 with the one in this zip, it should fix that I believe.
Il2CppInterop.Runtime.dll.zip

If it crashes after that, it's likely actually the stripping issue.

@amir16yp
Copy link

@amir16yp That doesn't look like a stripping issue, that looks like the initial issue that Muse Dash had. If you replace the Il2CppInterop.Runtime.dll in /sdcard/MelonLoader/{package}/MelonLoader/net8 with the one in this zip, it should fix that I believe. Il2CppInterop.Runtime.dll.zip

If it crashes after that, it's likely actually the stripping issue.

now i get the different error and the game crashes before getting into the main menu

[01:42:03.560] Initialized JNI
[01:42:03.876] ------------------------------
[01:42:03.878] MelonLoader v0.6.5 Open-Beta
[01:42:03.882] OS: Android 14
[01:42:03.882] Hash Code: 5CD70450DB040884645CC87694335EB2DEFBB8CE840FC149EED709EAD3D2B03F
[01:42:03.883] ------------------------------
[01:42:03.883] Game Type: Il2cpp
[01:42:03.883] Game Arch: x64
[01:42:03.883] ------------------------------
[01:42:03.885] Command-Line: 
[01:42:03.886] ------------------------------
[01:42:03.887] Core::BasePath = /storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators
[01:42:03.887] Game::BasePath = /storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators
[01:42:03.888] Game::DataPath = bin/Data/
[01:42:03.889] Game::ApplicationPath = /system/bin/app_process64
[01:42:03.889] Runtime Type: net8
[01:42:04.469] ------------------------------
[01:42:04.469] Game Name: Dictators:No Peace
[01:42:04.470] Game Developer: AarJeeBee
[01:42:04.479] Unity Version: 2022.3.41f1
[01:42:04.479] Game Version: 59
[01:42:04.479] ------------------------------

[01:42:05.607] DotnetAssemblyLoadContextFix Exception: System.NullReferenceException: Null method for MelonLoader
   at HarmonyLib.PatchProcessor.Patch()
   at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer, HarmonyMethod ilmanipulator)
   at MelonLoader.Fixes.DotnetAssemblyLoadContextFix.Install()
[01:42:06.116] HarmonyLib.HarmonyException: IL Compile Error (unknown location)
 ---> HarmonyLib.HarmonyException: IL Compile Error (unknown location)
 ---> System.MissingMethodException: Method not found: void Il2CppInterop.Runtime.Injection.RegisterTypeOptions.set_LogSuccess(bool)
   at System.RuntimeMethodHandle.GetFunctionPointer()
   at MonoMod.Core.Platforms.Runtimes.MonoRuntime.Compile(MethodBase method)
   at MonoMod.Core.Platforms.PlatformTriple.Compile(MethodBase method)
   at MonoMod.RuntimeDetour.DetourManager.ManagedDetourState.UpdateEndOfChain()
   at MonoMod.RuntimeDetour.DetourManager.ManagedDetourState.AddILHook(SingleILHookState ilhook, Boolean takeLock)
   at MonoMod.RuntimeDetour.ILHook.Apply()
   at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo(MethodBase replacement)
   --- End of inner exception stack trace ---
   at HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo(MethodBase replacement)
   at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
   --- End of inner exception stack trace ---
   at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
   at HarmonyLib.PatchProcessor.Patch()
   at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer, HarmonyMethod ilmanipulator)
   at MelonLoader.Fixes.Il2CppInteropFixes.Install()
[01:42:06.343] Preferences Loaded!

[01:42:06.437] Loading UserLibs from '/storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators/UserLibs'...

[01:42:06.447] Loading Plugins from '/storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators/Plugins'...
[01:42:06.455] 0 Plugins loaded.
[01:42:06.692] Loading Il2CppAssemblyGenerator...
[01:42:06.774] [Il2CppAssemblyGenerator] Contacting RemoteAPI...
[01:42:07.887] [Il2CppAssemblyGenerator] Game Not Found on RemoteAPI Host (https://api.melonloader.com/api/v1/game/dictators-no-peace)
[01:42:07.887] [Il2CppAssemblyGenerator] RemoteAPI.DumperVersion = null
[01:42:07.887] [Il2CppAssemblyGenerator] RemoteAPI.ObfuscationRegex = null
[01:42:07.887] [Il2CppAssemblyGenerator] RemoteAPI.MappingURL = null
[01:42:07.887] [Il2CppAssemblyGenerator] RemoteAPI.MappingFileSHA512 = null
[01:42:07.905] [Il2CppAssemblyGenerator] Using Cpp2IL Version: 2022.1.0-pre-release.16
[01:42:07.905] [Il2CppAssemblyGenerator] Using Il2CppInterop Version = 1.4.6+5c0c44bfc31bc50023fb7426fc4a32b2086f672b
[01:42:07.905] [Il2CppAssemblyGenerator] Using Unity Dependencies Version = 2022.3.41
[01:42:07.905] [Il2CppAssemblyGenerator] Using Deobfuscation Regex = null
[01:42:07.906] [Il2CppAssemblyGenerator] UnityDependencies is up to date.
[01:42:07.906] [Il2CppAssemblyGenerator] Checking GameAssembly...
[01:42:08.029] [Il2CppAssemblyGenerator] Assembly is up to date. No Generation Needed.

[01:42:08.031] Loading Mods from '/storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators/Mods'...
[01:42:08.032] ------------------------------
[01:42:08.038] Melon Assembly loaded: './Mods/TestMelonMod.dll'
[01:42:08.038] SHA256 Hash: 'A77DD32EA6E09F1EB4E88921261DC4F4D4D1777FA30F452229E0FBA0B925D24E'

[01:42:08.158] ------------------------------
[01:42:08.160] testmod for dictators no peace v1.0
[01:42:08.160] by amir16yp
[01:42:08.161] Assembly: TestMelonMod.dll
[01:42:08.161] ------------------------------
[01:42:08.161] ------------------------------
[01:42:08.162] 1 Mod loaded.

[01:42:08.551] [Il2CppInterop] Target hook method Class::GetDefaultFieldValue not found
[01:42:08.551] [Il2CppInterop] System.Exception: Unity 2022.3.41 is not supported at the moment: MonoField isn't present in Il2Cppmscorlib.dll for unity version, unable to fetch icall
   at Il2CppInterop.Runtime.Injection.Hooks.Class_GetFieldDefaultValue_Hook.FindClassGetFieldDefaultValueXref(Boolean forceICallMethod)
   at Il2CppInterop.Runtime.Injection.Hooks.Class_GetFieldDefaultValue_Hook.FindTargetMethod()
   at Il2CppInterop.Runtime.Injection.Hook`1[[Il2CppInterop.Runtime.Injection.Hooks.Class_GetFieldDefaultValue_Hook.MethodDelegate, Il2CppInterop.Runtime, Version=1.4.6.0, Culture=neutral, PublicKeyToken=null]].ApplyHook()
[01:42:08.594] [Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[01:42:08.678] [Il2CppInterop] Registered mono type MelonLoader.Support.MonoEnumeratorWrapper in il2cpp domain
[01:42:08.687] [Il2CppInterop] Registered mono type MelonLoader.Support.SM_Component in il2cpp domain
[01:42:08.725] Support Module Loaded: /storage/emulated/0/MelonLoader/com.AarJeeBee.Dictators/MelonLoader/Dependencies/SupportModules/Il2Cpp.dll
[01:42:08.771] [testmod_for_dictators_no_peace] INIT MOD

@TrevTV
Copy link
Member Author

TrevTV commented Oct 19, 2024

I've never actually seen that before, but I'd assume it's crashing if it doesn't support that Unity version, like the error says.

@Erisfiregamer1
Copy link

Any progress made on this or is it just an “I have no idea where to begin” issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants
@TrevTV @Erisfiregamer1 @Pietrodjaowjao @lrutjens @amir16yp and others