FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.74k stars 404 forks source link

[Unstable] Crashing on startup (type initializer for 'GameAnalyticsSDK.Net.Logging.GALogger' threw an exception) #9813

Closed Regalis11 closed 2 years ago

Regalis11 commented 2 years ago

Disclaimers

What happened?

Some players are reporting a GameAnalytics-related crash on startup in the latest unstable. I suspect this has something to do with the .NET 6 upgrade.

Barotrauma Client crash report (generated on 09/02/2022 12:02:47)


Game version 0.19.3.0 (UnstableWindows, branch feature/tutorial-rework, revision 628c44892b)
Graphics mode: 1600x900 (Fullscreen)
VSync OFF
Language: English
Selected content packages: Vanilla
Level seed: no level loaded
Loaded submarine: None
Selected screen: Barotrauma.MainMenuScreen
SteamManager initialized

System info:
    Operating system: Microsoft Windows NT 10.0.19043.0 64 bit
    GPU name: NVIDIA GeForce GT 1030
    Display mode: {Width:1600 Height:900 Format:Color AspectRatio:1.7777778}
    GPU status: Normal

Exception: The type initializer for 'GameAnalyticsSDK.Net.Logging.GALogger' threw an exception. (System.TypeInitializationException)
Target site: Void D(System.String)
Stack trace: 
   at GameAnalyticsSDK.Net.Logging.GALogger.D(String format) in <DEV>\Libraries\GameAnalytics\GA-SDK-MONO-SHARED\Logging\GALogger.cs:line 143
   at GameAnalyticsSDK.Net.Threading.GAThreading.Run() in <DEV>\Libraries\GameAnalytics\GA-SDK-MONO-SHARED\Threading\GAThreading.cs:line 66
   at System.Threading.Thread.StartCallback()

InnerException: The type initializer for 'NLog.Targets.DefaultJsonSerializer' threw an exception.
Target site: Void .ctor(System.Reflection.Assembly[])
Stack trace: 
   at NLog.Config.ConfigurationItemFactory..ctor(Assembly[] assemblies)
   at NLog.Config.ConfigurationItemFactory.BuildDefaultFactory()
   at NLog.Config.ConfigurationItemFactory.get_Default()
   at NLog.Targets.TargetWithLayout..ctor()
   at NLog.Targets.ColoredConsoleTarget..ctor()
   at GameAnalyticsSDK.Net.Logging.GALogger..ctor() in <DEV>\Libraries\GameAnalytics\GA-SDK-MONO-SHARED\Logging\GALogger.cs:line 85
   at GameAnalyticsSDK.Net.Logging.GALogger..cctor() in <DEV>\Libraries\GameAnalytics\GA-SDK-MONO-SHARED\Logging\GALogger.cs:line 20

Reproduction steps

I did not test this myself yet, but presumably happens when starting the game with GameAnalytics enabled (on some systems?)

Bug prevalence

Happens every time I play

Version

0.19.2.0 (unstable)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Tsunder commented 2 years ago

workaround is to :

In steam go to the game, right click in the library and manage. Browse local files rename or delete /barotrauma/GameAnalytics.NetStandard.dll

juanjp600 commented 2 years ago

Should be fixed in https://github.com/Regalis11/Barotrauma-development/commit/a9421a7e5a1b45802d5c4b4d0726ee3e1f7bac46

NilanthAnimosus commented 2 years ago

Tested against dev commit https://github.com/Regalis11/Barotrauma-development/commit/7f3f6c800271e4dbdc682bb79cdd4e7e6c074a11, no issues found, closing.

notes:

made sure to run this in release outside the IDE after building, and make sure game analytics was running. Given it crashed for me in the 0.19.13.0 unstable build, considering this fixed as game analytics now ran fine.