1. This forum is archived for reference. For support & bug reports visit the help section of forums.stardewvalley.net

SMAPI Aborting Immediately

Discussion in 'Support' started by tigergirl158, Apr 6, 2018.

  1. tigergirl158

    tigergirl158 Void-Bound Voyager

    I haven't played in a while and set about updating mods, etc. I'm using the latest versions of the game and SMAPI, but as soon as I open it I get this error and the entire thing shuts down in seconds. Any help...?

    An error occured in the overridden update loop: System.ArgumentException: An item with the same key has already been added.
    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
    at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
    at StardewModdingAPI.Program.LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, ContentCore contentCore, ModDatabase modDatabase) in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 737
    at StardewModdingAPI.Program.InitialiseAfterGameStart() in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 395
    at StardewModdingAPI.Framework.SGame.Update(GameTime gameTime) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\SGame.cs:line 321
    I'm not that great at this kind of thing and I have no idea what could be going wrong :(
     
    • Neoclew

      Neoclew Master Chief

      I'm certainly no expert but this line "An item with the same key has already been added." Makes me think you have two conflicting mods. Think of it this way, objects are assigned to a number (i.e. slime 0, rock crabs 1, not actual numbers). Now you have one mod trying to assign a to number 2, and one mod trying to assign b to number 2.

      Tl;Dr remove all modset and add them in one at a time until smapi gives this error again, and you'll find one of the mods that conflicts with the others. Then remove the other mods one at a time, and when it works, you've found both conflicting mods. Decide which one you want to keep.
       
      • tigergirl158

        tigergirl158 Void-Bound Voyager

        Thanks for the suggestion! I tried this and uh... it turned out to be... my sebastian doki doki dialogue pack for content patcher.......................

        (*゚ー゚)ゞ
         
        • Pathoschild

          Pathoschild Tiy's Beard

          Hi @tigergirl158. SMAPI shouldn't crash like that; I'll fix that in the next version. In the meantime, make sure both mods have exactly the same ContentPackFor UniqueID in their manifest.json (including same capitalisation) to fix that. :)
           
            Neoclew likes this.
          • Pangaearocks

            Pangaearocks Big Damn Hero

            Similar error message in this crash I just reported.

            Don't know if SMAPI is what caused the crash or the game itself. But one part of the rather big error log mentions:
            Code:
            [23:18:08 ERROR SMAPI] An error occured in the overridden update loop: System.ArgumentException: An item with the same key has already been added.
              at System.ThrowHelper.ThrowArgumentException (ExceptionResource resource) <0x410617c0 + 0x00027> in <filename unknown>:0
              at System.Collections.Generic.Dictionary`2[TKey,TValue].Insert (System.Collections.Generic.TKey key, System.Collections.Generic.TValue value, Boolean add) <0x40d2c1e0 + 0x00123> in <filename unknown>:0
              at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (System.Collections.Generic.TKey key, System.Collections.Generic.TValue value)
            ....
            [23:18:09 ERROR SMAPI] SMAPI requested an immediate game shutdown: the game crashed when updating, and SMAPI was unable to recover the game.
            I only have only one mod installed though (besides SMAPI), namely the UI Info Suite.
             
            • Pathoschild

              Pathoschild Tiy's Beard

              @Pangaearocks You had duplicate item references in your inventory, which would cause all sorts of weird effects (including a SMAPI crash). I fixed the crash in the upcoming SMAPI 2.5.5 though.
               
                Last edited: Apr 11, 2018

              Share This Page