Environment:
- Stardew Valley 1.6.15.3 (build 26177) on Android
- SMAPI v4.3.2.4
- CustomBackpackFramework v1.2.0
Bug:
The mod crashes on entry with this error:
[ERROR The Return of Custom Backpack Framework] Mod crashed on entry and might not work correctly. Technical details:
AggregateException: One or more errors occurred. (Null method for platinummyr.CustomBackpackFramework)
---> NullReferenceException: Null method for platinummyr.CustomBackpackFramework
at HarmonyLib.PatchProcessor.Patch()
at HarmonyLib.Harmony.Patch(...)
at CustomBackpack.ModEntry.Entry(IModHelper helper)
Root cause:
In ModEntry.cs, this patch call:
harmony.Patch(
original: AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw)),
prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix))
);
AccessTools.Method(typeof(SeedShop), "draw") returns null on the Android build — likely because SeedShop.draw doesn't exist or has a different signature on mobile. Passing original: null into harmony.Patch() throws immediately, aborting Entry() before any other patches or the mod's actual functionality get applied.
Suggested fix:
Guard this specific patch with a null check so it doesn't abort the whole Entry() method on platforms where SeedShop.draw isn't found:
var seedShopDraw = AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw));
if (seedShopDraw != null)
{
harmony.Patch(
original: seedShopDraw,
prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix))
);
}
else
{
Monitor.Log("Skipped SeedShop.draw patch (method not found on this platform).", LogLevel.Warn);
}
Happy to test a build on Android if you put one together — thanks for maintaining this mod!
Environment:
Bug:
The mod crashes on entry with this error:
[ERROR The Return of Custom Backpack Framework] Mod crashed on entry and might not work correctly. Technical details:
AggregateException: One or more errors occurred. (Null method for platinummyr.CustomBackpackFramework)
---> NullReferenceException: Null method for platinummyr.CustomBackpackFramework
at HarmonyLib.PatchProcessor.Patch()
at HarmonyLib.Harmony.Patch(...)
at CustomBackpack.ModEntry.Entry(IModHelper helper)
Root cause:
In ModEntry.cs, this patch call:
harmony.Patch(
original: AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw)),
prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix))
);
AccessTools.Method(typeof(SeedShop), "draw") returns null on the Android build — likely because SeedShop.draw doesn't exist or has a different signature on mobile. Passing original: null into harmony.Patch() throws immediately, aborting Entry() before any other patches or the mod's actual functionality get applied.
Suggested fix:
Guard this specific patch with a null check so it doesn't abort the whole Entry() method on platforms where SeedShop.draw isn't found:
var seedShopDraw = AccessTools.Method(typeof(SeedShop), nameof(SeedShop.draw));
if (seedShopDraw != null)
{
harmony.Patch(
original: seedShopDraw,
prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.SeedShop_draw_Prefix))
);
}
else
{
Monitor.Log("Skipped SeedShop.draw patch (method not found on this platform).", LogLevel.Warn);
}
Happy to test a build on Android if you put one together — thanks for maintaining this mod!