Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Validation error upon run/build

Discussion in 'Project Tiny' started by Michael-N3rkmind, Jan 2, 2019.

  1. Michael-N3rkmind

    Michael-N3rkmind

    Joined:
    Aug 16, 2015
    Posts:
    24
    Hey!

    I've been working on my project for a little while now, and had to modify some entities within my group.
    I remember using control-z to undo a color change on the color picker, and then saw another entity within my group disappear.

    Ever since, i get a Null reference exception when i try to simply run, or build the project. Here is the error, and the stack

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Unity.Tiny.TinyEntityGroup.Visit (Unity.Tiny.TinyProject+Visitor visitor) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Runtime/Runtime/Data/TinyEntityGroupVisitor.cs:16)
    3. Unity.Tiny.TinyModule.Visit (Unity.Tiny.TinyProject+Visitor visitor) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Runtime/Runtime/Core/TinyModuleVisitor.cs:50)
    4. Unity.Tiny.TinyProject.Visit (Unity.Tiny.TinyProject+Visitor visitor) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Runtime/Runtime/Core/TinyProjectVisitor.cs:30)
    5. Unity.Tiny.TinyProjectValidation.Validate (Unity.Tiny.TinyProject project) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Export/TinyProjectValidation.cs:12)
    6. Unity.Tiny.TinyBuildPipeline.Build (Unity.Tiny.TinyBuildOptions options) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Export/TinyBuildPipeline.cs:372)
    7. Unity.Tiny.TinyBuildPipeline.BuildAndLaunch () (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Export/TinyBuildPipeline.cs:243)
    8. Unity.Tiny.UTProjectScriptedImporterEditor.OnInspect (Unity.Tiny.TinyProject module) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/ScriptableObject/UTProjectScriptedImporterEditor.cs:153)
    9. Unity.Tiny.TinyScriptedImporterEditorBase`2[TAssetImporterType,TRegistryObject].OnInspectorGUI () (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/ScriptableObject/TinyScriptedImporterEditorBase.cs:174)
    10. UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
    11. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    I'm looking for a way to correct this corrupted data, i've tried :
    - Adding an entity with the same name/component
    - Re-doing the whole entityGroup

    Any help with this would be greatly apreciated!
     
  2. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    122
    Can you look for a component that is red in an inspected entity. Do you have any EntityReferences?
     
  3. Michael-N3rkmind

    Michael-N3rkmind

    Joined:
    Aug 16, 2015
    Posts:
    24
    So i don't see anything in the red within my entities, and i hold no references. I've got a total of 5 groups is my whole project. I'm looking through the .utdata to find the anomality right now.
     
  4. Michael-N3rkmind

    Michael-N3rkmind

    Joined:
    Aug 16, 2015
    Posts:
    24
    So, turns out one of my entityGroup had an entity that i could not see from within the inspector.

    To find which one it was, i've hack an output in the TinyEntityGroupVisitor script, using System.IO.
    The last line written was the parent of my missing Entity.

    The entity in question was a Panel, under a Canvas entity

    For the curious, this is was i've used
    Code (CSharp):
    1. using System.IO;
    2.  
    3. namespace Unity.Tiny
    4. {
    5.     internal sealed partial class TinyEntityGroup
    6.     {
    7.         public void Visit(TinyProject.Visitor visitor)
    8.         {
    9.             using (System.IO.StreamWriter file =
    10.             new System.IO.StreamWriter(@"./debug.txt"))
    11.             {
    12.                 visitor.VisitEntityGroup(this);
    13.  
    14.                 file.WriteLine("start");
    15.                 foreach (var reference in Entities)
    16.                 {
    17.                     file.WriteLine("Ref + " + reference);
    18.                     var entity = reference.Dereference(Registry);
    19.                     visitor.VisitEntity(entity);
    20.                     foreach (var component in entity.Components)
    21.                     {
    22.                         file.WriteLine("Comp " + component);
    23.                         visitor.VisitComponent(component);
    24.                     }
    25.                 }
    26.             }
    27.         }
    28.     }
    29. }
    30.  
    31.  
     
    Deleted User likes this.
  5. SorneBachse

    SorneBachse

    Joined:
    Dec 27, 2012
    Posts:
    62
    So, I'm also stuck with this same issue and the only output I get from the debug.txt is this:

    Code (CSharp):
    1. start
    2. Ref + Reference EnemySprite_Long
    3. Comp Unity.Tiny.TinyObject
    4. Comp Unity.Tiny.TinyObject
    5. Comp Unity.Tiny.TinyObject
    6. Comp Unity.Tiny.TinyObject
    7. Comp Unity.Tiny.TinyObject
    8. Comp Unity.Tiny.TinyObject
    9. Comp Unity.Tiny.TinyObject
    10. Comp Unity.Tiny.TinyObject
    11. Comp Unity.Tiny.TinyObject
    12. Comp Unity.Tiny.TinyObject
    13. Comp Unity.Tiny.TinyObject
    14. Ref + Reference Entity
    15.  
    Which I don't feel like is helpful at all?

    It happened when I created an entity with a Text2DRenderer, Text2DStyle and NativeFont. Suddenly I can't build and play.
    I've tried uninstalling/installing Utiny, deleted the Tiny folder + library and reimported everything but nothing seems to work :\

    EDIT:
    Okay so I was able to fix it, by reverting my changes in git.
     
    Last edited: Jan 23, 2019
  6. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    122
    Thanks for the feedback @SoerenBachNielsen. We're still looking into this issue. If you can reproduce the issue consistently please DM me.
     
    SorneBachse likes this.
  7. Deleted User

    Deleted User

    Guest

    Thank you @Michael-N3rkmind

    My project was working fine yesterday and suddenly stopped today, after using your code, i have found out one of my EntityGroups became invalid.

    God bless Git for let me revert everything back to a valid working state again :p.


    Thank you again. Have a nice day!
     
  8. Pakor

    Pakor

    Joined:
    Feb 2, 2017
    Posts:
    32
    I just want to add that I have had the validation errors a couple of times too. The way I solved them was just closing the tiny project and opening it again. Somehow this fixes it for me everytime. Might be that I got a different kind of validation error though..
     
    Deleted User likes this.
  9. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    Control Z is dangerous to use in Unity TIny from my experience. I usually save before i press it.

    main issue iv noticed with it is it brings back all your deleted tiles alot of the times when you control Z anything. Same with duplicating