Welcome, Guest
Username: Password: Remember me

TOPIC: [Exception] Array index is out of range

[Exception] Array index is out of range 4 months 2 weeks ago #3251

I was demoing our game at EGX Berlin this weekend and got an unexpected crash (once). Checking the logs I suspect it may have been caused by I2 Localize giving me this cryptic stacktrace:

IndexOutOfRangeException: Array index is out of range.
at I2.Loc.LanguageSource.Export_Language_to_Cache (Int32 langIndex, Boolean fillTermWithFallback) [0x00000] in <filename unknown>:0
at I2.Loc.LanguageSource.SaveLanguages (Boolean unloadAll, eFileType fileLocation) [0x00000] in <filename unknown>:0
at I2.Loc.LanguageSource.UpdateDictionary (Boolean force) [0x00000] in <filename unknown>:0
at I2.Loc.LocalizationManager.AddSource (I2.Loc.LanguageSource Source) [0x00000] in <filename unknown>:0
at I2.Loc.LocalizationManager.RegisterSourceInResources () [0x00000] in <filename unknown>:0
at I2.Loc.LocalizationManager.UpdateSources () [0x00000] in <filename unknown>:0
at I2.Loc.LocalizationManager.InitializeIfNeeded () [0x00000] in <filename unknown>:0
at I2.Loc.LocalizationManager.get_CurrentLanguage () [0x00000] in <filename unknown>:0
at I2.Loc.Localize.OnLocalize (Boolean Force) [0x00000] in <filename unknown>:0
at I2.Loc.Localize.Awake () [0x00000] in <filename unknown>:0

I can't really wrap my head around what's going on here, but I guess somehow OnLocalize triggers initialization which in turn tries to update and save the dictionary data with an invalid language index. The game was running on German systems which correctly localized all content into German (after the initial crash).

Game is built with Unity 2018.1.3f1 with I2 Loc 2.8.7 and the crash occured on Windows (not sure which version).

Any help is much appreciated!
The administrator has disabled public write access.

[Exception] Array index is out of range 4 months 1 week ago #3256

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1178
  • Thank you received: 253
  • Karma: 78
Hmm, sorry for the delay, I have been trying to reproduce that crash for a few days now without success.

Can you try upgrading to v2.8.8 or 2.8.9 and see if you can reproduce it?
There have been several changes around the way the languages are handled in the cache in the latest release. That may solve your problem.

Hope that helps,
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.

[Exception] Array index is out of range 4 months 1 week ago #3259

I also havn't been able to reproduce the crash, I suppose it's that kind of "heisinbug" that only occurs when you're showing your game to someone else ;)

Thanks for replying!
The administrator has disabled public write access.
Time to create page: 0.097 seconds
Template by JoomlaShine