Hello Guest

Author Topic: Team Server / Exception  (Read 4354 times)

LilBitStudio

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Team Server / Exception
« on: May 12, 2014, 05:05:57 pm »
Is there a known fix for the following exception:

NullReferenceException: Object reference not set to an instance of an object
tk2dSpriteCollectionBuilder.Rebuild (.tk2dSpriteCollection gen) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionBuilder.cs:691)
tk2dSpriteCollectionBuilder.RebuildOutOfDate (System.String[] changedPaths) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionBuilder.cs:151)
tk2dSpriteCollectionTextureWatcher.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionTextureWatcher.cs:24)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets)

This exception gets thrown periodically when pulling updates via Team Server. When it happens, the "Data Object" gets lost in the Settings for the sprite atlas. Then it begins creating new prefabs within the sprite collection folder. To fix, we keep having to go in and remove the extraneous prefab objects and then manually reattach the correct prefab to the Data object setting.

Thanks - Scott

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Team Server / Exception
« Reply #1 on: May 14, 2014, 01:11:34 pm »
When this happens it means one of the data objects is broken. Does the icon on the data object look wrong? It should be a blue cube for a prefab, when it gets broken it turns white, like an unknown document. I've seen this happen at random points, even with text serialization in Unity. The contents of the file is still usually valid, but Unity refuses to interpret it correctly. In the case of text serialization, its possible to fix it by modifying the file slightly, eg. adding a space to the end of a line and Unity then detects it correctly... I've reported this bug to Unity with a repro case but as far as I can tell its not been fixed yet.

LilBitStudio

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Team Server / Exception
« Reply #2 on: May 14, 2014, 03:50:58 pm »
Thanks.

The originals seem just fine. I never see them as broken at all. To fix, I just delete the enumerated duplicates and drag and drop the original back onto the Data object property in settings.

In my case, the problem seems to show up whenever a second person has modified and committed to Team Server. Then it happens to either me or them in the update. Which makes me wonder if the problem is occurring because of the order of the changes/updates happening in the update process.

Thanks again. Despite a few minor quirks, 2D Toolkit is still hands down the most valuable Unity asset to us! Scott

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Team Server / Exception
« Reply #3 on: May 15, 2014, 09:48:30 pm »
Hmm... the other known issue that can cause this (not related to any version control) is a unity bug that has apparently been fixed and will be in the next version according to the email.  Sadly there is no sure fire way to determine if its the bug that is causing it, especially if you're not using text serialization.