Issue Mods crashing because of HarmonyLib.FileLog on MacOS

Frinkh

Greenhorn
Hello everyone,

I installed some mods on my girlfriend MacOS computer.
Most of the are working fine but some of the mods required for RidgeSide are sending errors.
Here are the SMAPI logs :

Code:
[SMAPI] SMAPI 3.15.1 with Stardew Valley 1.5.6 (build 1.3.37.0) on macOS Unix 12.5.0

[SMAPI] Mods go here: /Users/nellydufau/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/Mods

[SMAPI] Waiting for game to launch...

[SMAPI] Loading mod metadata...

[SMAPI] Loading mods...

[SMAPI] Loaded 31 mods:

[SMAPI]    AntiSocial NPCs 1.0.6 by Super Aardvark | Allows modders to create NPCs that the player can't befriend.

[SMAPI]    AtraCore 0.1.1 by atravita | A core library mod some of my other mods depend on.

[SMAPI]    AutomaticGates 2.5.3 by Rakiin aKa ScheKaa | Opens and closes gates automatically

[SMAPI]    CJB Cheats Menu 1.31.0 by CJBok and Pathoschild | Simple in-game cheats menu!

[SMAPI]    Console Commands 3.15.1 by SMAPI | Adds SMAPI console commands that let you manipulate the game.

[SMAPI]    Content Patcher 1.27.2 by Pathoschild | Loads content packs which edit game data, images, and maps without changing the game files.

[SMAPI]    Custom Companions 2.5.0 by PeacefulEnd | Framework for creating custom entities that can be spawned on maps or follow you around in Stardew Valley.

[SMAPI]    Custom NPC Exclusions 1.4.0 by Esca | Allows modders to exclude custom NPCs from quests and events via Content Patcher.

[SMAPI]    Custom NPC Fixes 1.2.4 by spacechase0 | Fixes NPC spawning in custom locations, pathing to custom locations, and schedules for new NPCs.

[SMAPI]    Custom Spouse Patio 0.10.0 by aedenthorn | Lets you create a custom spouse patio.

[SMAPI]    Error Handler 3.15.1 by SMAPI | Handles some common vanilla errors to log more useful info or avoid breaking the game.

[SMAPI]    Expanded Preconditions Utility 1.0.1 by Cherry | A condition checking system designed for use by other mods, in the format of event preconditions

[SMAPI]    Extra Map Layers 0.3.3 by aedenthorn | Draws additional layers from map files.

[SMAPI]    Farm Type Manager 1.16.0 by Esca | Allows custom spawning of content from each farm type: forage, large objects, ore, and monsters

[SMAPI]    Generic Mod Config Menu 1.9.3 by spacechase0 | Adds an in-game UI to edit other mods' config options (for mods which support it).

[SMAPI]    Holiday Sales 0.1.0 by atravita | Makes merchants stay open on festival days, if the festival's out of town. (Configurable!)

[SMAPI]    Json Assets 1.10.7 by spacechase0 | Lets content packs add custom content to the game.

[SMAPI]    Mail Framework Mod 1.12.2 by Digus | Utility classes to send mail in the game.

[SMAPI]    Multiple Spouses 3.2.1 by aedenthorn | Allows you to have multiple spouses at once.

[SMAPI]    NPC Map Locations 2.9.3 by Bouhm | Shows NPCs and farmers on a modified map page for accurate tracking.

[SMAPI]    Quest Framework 1.4.2 by PurrplingCat | Add, edit and manage your own quests and create new quest types.

[SMAPI]    Ridgeside Village SMAPI 2.1.4 by Rafseazz | Ridgeside Village SMAPI and Harmony Component

[SMAPI]    SAAT.API 1.1.2 by ZeroMeters | Audio API for SMAPI

[SMAPI]    SAAT.Mod 1.1.2 by ZeroMeters | Custom Audio Loader & Management for SMAPI

[SMAPI]    Save Backup 3.15.1 by SMAPI | Automatically backs up all your saves once per day into its folder.

[SMAPI]    Shop Tile Framework 1.0.9 by Cherry | Define new shops as custom tile properties

[SMAPI]    Show Birthdays 1.3.0 by Traktori | Allows the calendar to display multiple birthdays.

[SMAPI]    Skip Intro 1.9.9 by Pathoschild | Skips the game's loading intro.

[SMAPI]    SpaceCore 1.9.2 by spacechase0 | A framework mod used by some of my other mods.

[SMAPI]    StardewHack 5.2.0 by bcmpinc | Transpilation library used by my other mods. Doesn't do much on its own.

[SMAPI]    Tractor Mod 4.15.5 by Pathoschild | Lets you buy a tractor to more efficiently work with crops, clear twigs and rocks, etc.



[SMAPI] Loaded 12 content packs:

[SMAPI]    Babies Take After Spouse v1 1.4.1 by lakoria | for Content Patcher | Changes the baby and toddler spritesheets based on your spouse.

[SMAPI]    Elle's New Barn Animals 1.1.3 by Elle/Junimods | for Content Patcher | A CP replacement for all your barn animals!

[SMAPI]    Elle's New Coop Animals 1.1.5 by Elle/Junimods | for Content Patcher | A CP replacement for all your coop animals!

[SMAPI]    Ridgeside Village - Content Patcher 2.1.4 by Rafseazz | for Content Patcher | Adds Ridgeside Village to the game. A Stardew Valley Expansion mod.

[SMAPI]    Ridgeside Village - Custom Companions 2.1.4 by Rafseazz | for Custom Companions | Custom Companions pack for Ridgeside Village.

[SMAPI]    Ridgeside Village - Custom Music 2.1.4 by Rafseazz | for SAAT.Mod | Adds Custom Audio to Ridgeside Village.

[SMAPI]    Ridgeside Village - Farm Type Manager 2.1.4 by Rafseazz | for Farm Type Manager | Adds forage and monsters to Ridgeside Village.

[SMAPI]    Ridgeside Village - JSON Assets 2.1.4 by Rafseazz | for Json Assets | Adds custom items to Ridgeside Village.

[SMAPI]    Ridgeside Village - Mail Framework Mod 2.1.4 by Rafseazz | for Mail Framework Mod | Adds mail related assets for Ridgeside Village.

[SMAPI]    Ridgeside Village - Quest Framework 2.1.4 by Rafseazz | for Quest Framework | Loads Quest Framework Quests for Ridgeside Village.

[SMAPI]    Ridgeside Village - Shop Tile Framework 2.1.4 by Rafseazz | for Shop Tile Framework | Adds shops to Ridgeside Village.

[SMAPI]    Seasonal Cute Characters 3.2.3 by Poltergeister with assets by various artists | for Content Patcher | Seasonal outfits with the slightly cuter character aesthetic.



[SMAPI] Found 16 mods with warnings:

[SMAPI]    Changed save serializer

[SMAPI]    --------------------------------------------------

[SMAPI]       These mods change the save serializer. They may corrupt your save files, or make them unusable if

[SMAPI]       you uninstall these mods.



[SMAPI]       - SpaceCore



[SMAPI]    Patched game code

[SMAPI]    --------------------------------------------------

[SMAPI]       These mods directly change the game code. They're more likely to cause errors or bugs in-game; if

[SMAPI]       your game has issues, try removing these first. Otherwise you can ignore this warning.



[SMAPI]       - AntiSocial NPCs

[SMAPI]       - AtraCore

[SMAPI]       - Custom Companions

[SMAPI]       - Custom NPC Exclusions

[SMAPI]       - Custom Spouse Patio

[SMAPI]       - Extra Map Layers

[SMAPI]       - Farm Type Manager

[SMAPI]       - Holiday Sales

[SMAPI]       - Json Assets

[SMAPI]       - Mail Framework Mod

[SMAPI]       - Multiple Spouses

[SMAPI]       - Quest Framework

[SMAPI]       - Ridgeside Village SMAPI

[SMAPI]       - Shop Tile Framework

[SMAPI]       - SpaceCore

[SMAPI]       - StardewHack



[SMAPI] Launching mods...

[Quest Framework] Loaded 1 content packs:

[Quest Framework]    Ridgeside Village - Quest Framework 2.1.4 by Rafseazz (Rafseazz.RSVQF)

[Farm Type Manager] Mod crashed on entry and might not work correctly. Technical details:

TypeInitializationException: The type initializer for 'HarmonyLib.FileLog' threw an exception.

---> ArgumentException: Path cannot be the empty string or all whitespace. (Parameter 'path')

   at System.IO.Directory.CreateDirectory(String path)

   at HarmonyLib.FileLog..cctor()

   --- End of inner exception stack trace ---

   at HarmonyLib.FileLog.Debug(String str)

   at HarmonyLib.AccessTools.GetTypesFromAssembly(Assembly assembly)

   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()

   at FarmTypeManager.ModEntry.HarmonyPatch_ToggleExtraLoot.ApplyPatch(Harmony harmony)

   at FarmTypeManager.ModEntry.ApplyHarmonyPatches()

   at FarmTypeManager.ModEntry.Entry(IModHelper helper)

   at StardewModdingAPI.Framework.SCore.LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, ContentCoordinator contentCore, ModDatabase modDatabase)

[Extra Map Layers] Mod crashed on entry and might not work correctly. Technical details:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

---> TypeInitializationException: The type initializer for 'HarmonyLib.FileLog' threw an exception.

---> ArgumentException: Path cannot be the empty string or all whitespace. (Parameter 'path')

   at System.IO.Directory.CreateDirectory(String path)

   at HarmonyLib.FileLog..cctor()

   --- End of inner exception stack trace ---

   at HarmonyLib.FileLog.Debug(String str)

   at HarmonyLib.AccessTools.GetTypesFromAssembly(Assembly assembly)

   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()

   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)

   at HarmonyLib.AccessTools.TypeByName(String name)

   at HarmonyLib.Tools.TypColonName(String typeColonName)

   at HarmonyLib.AccessTools.Method(String typeColonName, Type[] parameters, Type[] generics)

   at ExtraMapLayers.ModEntry.Layer_DrawNormal_Transpiler(IEnumerable`1 instructions)

   --- End of inner exception stack trace ---

   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)

   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at HarmonyLib.CodeTranspiler.<>c__DisplayClass12_0.<GetResult>b__0(MethodInfo transpiler)

   at System.Collections.Generic.List`1.ForEach(Action`1 action)

   at HarmonyLib.CodeTranspiler.GetResult(ILGenerator generator, MethodBase method)

   at HarmonyLib.MethodBodyReader.FinalizeILCodes(Emitter emitter, List`1 transpilers, List`1 endLabels, Boolean& hasReturnCode)

   at HarmonyLib.MethodPatcher.CreateReplacement(Dictionary`2& finalInstructions)

   at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)

   at HarmonyLib.PatchProcessor.Patch()

   at ExtraMapLayers.ModEntry.Entry(IModHelper helper)

   at StardewModdingAPI.Framework.SCore.LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, ContentCoordinator contentCore, ModDatabase modDatabase)

[StardewHack] Loaded StardewHack library v5.2.0 using Harmony v2.2.1.0.

[Shop Tile Framework] Adding Content Packs...

[Shop Tile Framework] Loading: Ridgeside Village - Shop Tile Framework by Rafseazz | 2.1.4 | Adds shops to Ridgeside Village.

[AntiSocial NPCs] AntiSocial Mod performing stand-alone setup.

[SMAPI] Mods loaded and ready!

[S_API] SteamAPI_Init(): Loaded '/Users/nellydufau/Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/steamclient.dylib' OK.

Setting breakpad minidump AppID = 413150

SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  76561198920157681 [API loaded no]

[SMAPI] Type 'help' for help, or 'help <cmd>' for a command's usage

[Custom Companions] Successfully hooked into spacechase0.JsonAssets.

[Custom Companions] Successfully hooked into Pathoschild.ContentPatcher.

[Custom Companions] Loading companions from pack: Ridgeside Village - Custom Companions 2.1.4 by Rafseazz

[Json Assets]     Ridgeside Village - Custom Companions 2.1.4 by Rafseazz - Custom Companions pack for Ridgeside Village.

[Shop Tile Framework] BFAV API not detected. This is only an issue if you're using custom BFAV animals and a custom shop that's supposed to sell them, as custom animals will not appear in those shops.

[Holiday Sales] Mod crashed while applying harmony patches:



HarmonyLib.HarmonyException: Patching exception in method static System.Collections.Generic.IEnumerable`1<System.Reflection.MethodBase> HolidaySales.HarmonyPatches.PatchTownMethods::TargetMethods()

---> System.TypeInitializationException: The type initializer for 'HarmonyLib.FileLog' threw an exception.

---> System.ArgumentException: Path cannot be the empty string or all whitespace. (Parameter 'path')

   at System.IO.Directory.CreateDirectory(String path)

   at HarmonyLib.FileLog..cctor()

   --- End of inner exception stack trace ---

   at HarmonyLib.FileLog.Debug(String str)

   at HarmonyLib.AccessTools.GetTypesFromAssembly(Assembly assembly)

   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()

   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)

   at HarmonyLib.AccessTools.TypeByName(String name)

   at HolidaySales.HarmonyPatches.PatchTownMethods.TargetMethods()+MoveNext()

   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)

   at HarmonyLib.PatchClassProcessor.<GetBulkMethods>g__FailOnResult|12_1(IEnumerable`1 res)

   at HarmonyLib.PatchClassProcessor.RunMethod[S,T](T defaultIfNotExisting, T defaultIfFailing, Func`2 failOnResult, Object[] parameters)

   --- End of inner exception stack trace ---

   at HarmonyLib.PatchClassProcessor.ReportException(Exception exception, MethodBase original)

   at HarmonyLib.PatchClassProcessor.Patch()

   at HarmonyLib.Harmony.<PatchAll>b__10_0(Type type)

   at HarmonyLib.CollectionExtensions.Do[T](IEnumerable`1 sequence, Action`1 action)

   at HolidaySales.ModEntry.ApplyPatches(Harmony harmony)

[Json Assets] Loading content packs...

[Json Assets]     Ridgeside Village - JSON Assets 2.1.4 by Rafseazz - Adds custom items to Ridgeside Village.

/Users/nellydufau/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/StardewValley: line 162:  3273 Killed: 9               ./StardewModdingAPI "$@"

logout



Saving session...

...copying shared history...

...saving history...truncating history files...

...completed.
It seems that HarmonyLib.FileLog doesn't find the path to desktop on MacOS.

I tried to add an environment variable with (export HARMONY_NO_LOG="HARMONY_NO_LOG") in the .bash_profile to disable the logs, but it doesn't seem to work (actually I don't really know how I should write the environment variable)

Can you help me ? Because the game crashes sometimes and it's frustrating for my girlfriend.

Thank you !
 
Last edited by a moderator:

Lilydeiss

Newcomer
You can try this: https://github.com/pardeike/Harmony/issues/442

Instead of turning the logs off, specify a directory where the logs could be saved so path won't be an empty string.

Add this line to your ~/.bash_profile or ~/.zprofile (for M1):
export HARMONY_LOG_FILE="~/Desktop/Stardewlog"


This one worked for me. Hope it works for you too! :smile:
 
Top