Jump to content
Sign in to follow this  
jessefreeman

ProGroups Throwing Errors In Project

Recommended Posts

I have been using progroups for a few weeks and recently something got corrupted when I was refactoring and now it throws errors and nothing I do appears to stop it.

 

GameScene.unity-CigarSmuggler-Android.pn

 

I tried commenting out the line which offers a temporary fix. I've also removed and reinstalled the plugin and the error returns. I've also seen another error, which of course I can't find right now complaining about some kind of mapping issue.

 

How can I fully remove this plugin and it's meta data from my project and start over? I wasn't able to figure out where you store the group data which appears to be corrupted.

 

- Jesse

 

 

Share this post


Link to post
Share on other sites

Hey Jesse, sorry for the trouble.

 

To remove from your project and start anew, just delete the ProGroups folder and reimport.  

 

I think this may be an error from an older version of ProGroups though - when you click on the error, does the line it points to look like this?

objects = (GameObject[])objects.Where(x => !x.Equals(null)).ToArray();

If not, make sure you update ProGroups in the Asset Store window prior to re-importing.

Share this post


Link to post
Share on other sites

Yes that is the line. I've actually deleted the folder, updated and reinstalled but same problem and all my selection are restored once I comment out that line of code. When I get around to it I'll delete group one by one and try again. I have a dozen or so groups I'd rather not rebuild from scratch.

 

Thanks for the reply,

Jesse

Share this post


Link to post
Share on other sites

Ah, okay.  So it sounds like that object group is null somehow.  Try replacing that line with this instead:

objects = objects == null ? new GameObject[0] {} : (GameObject[])objects.Where(x => !x.Equals(null)).ToArray();

Share this post


Link to post
Share on other sites

I've just deleted all the groups, removed the plugin and its .meta file and reinstalled with the latest version from Asset Store. It's now throwing the following error as soon as I open the window and keeps erroring out.

NullReferenceException: Object reference not set to an instance of an object
ProGroups.Group.<RemoveNullOrEmpty>m__11 (UnityEngine.GameObject x) (at Assets/ProCore/ProGroups/Scripts/InScene/GroupContainer.cs:32)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[UnityEngine.GameObject].MoveNext ()
System.Collections.Generic.List`1[UnityEngine.GameObject].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[UnityEngine.GameObject]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[GameObject] (IEnumerable`1 source)
ProGroups.Group.RemoveNullOrEmpty () (at Assets/ProCore/ProGroups/Scripts/InScene/GroupContainer.cs:32)
ProGroups.GroupContainer.Clean () (at Assets/ProCore/ProGroups/Scripts/InScene/GroupContainer.cs:305)
ProGroups.ProGroups_Window.OnGUI () (at Assets/ProCore/ProGroups/Scripts/Editor/ProGroups_Window.cs:256)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

So I can't figure out how to get this to do a clean re-install at this point.

 

Thanks,

Jesse

Share this post


Link to post
Share on other sites

So this is strange. I tried your code but didn't help. Then I commented out line 32 again and one group is left from my previous project which doesn't allow me to delete it. Plus that is probably the one that has the error in it. What I don't understand is why when I delete the plugin from my project and reinstall the old groups are still saved. Where is this data written to in my project so I can delete that as well and try again?

 

Thanks,

Jesse

Share this post


Link to post
Share on other sites

One last thing, I just created a new group and tried to delete the only remaining one which is giving me the error. Here is what happened when I tried that:

NullReferenceException: Object reference not set to an instance of an object
ProGroups.GroupContainer.RemoveGroup (Int32 i) (at Assets/ProCore/ProGroups/Scripts/InScene/GroupContainer.cs:234)
ProGroups.ProGroups_Window.OnGUI () (at Assets/ProCore/ProGroups/Scripts/Editor/ProGroups_Window.cs:320)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Share this post


Link to post
Share on other sites

Well finally got rid of all the groups. I commented out the compiler conditional on line 234, deleted the group giving the error, and reinstalled the plugin again. It's strange that it keeps the data even when I delete everything but it looks like you need a better check in the remove group code to make sure the reference is no longer null. I did a big refactor a while back where I delete a few GameObjects that must have been in the groups. Either way it appears to be fixed now and I am just rebuilding my groups from scratch.

Share this post


Link to post
Share on other sites

Thanks for keeping the thread up to date - I've added some additional null checks to catch these sorts of errors.  I think the problem may have stemmed from a loose group from a previous install that wasn't cleaned up.  Which would make sense that it would be null in that case.  

 

Also, to shed a little light, groups are stored in the scene as hidden gameobjects.

Share this post


Link to post
Share on other sites

Interesting about the hidden gameobjects. I saw some reference to a gameobject while digging through the code but didn't know you can do that. I'd suggest a button that allows you to delete all groups or reset the plugin. Having that as an option would have solved the bulk of my problems.

 

Thanks,

Jesse

Share this post


Link to post
Share on other sites

I'm continuing to have issues with the following errors above. I rebuilt all the groups from as close to scratch as I could get it and I guess I may have changed a few items in the hierarchy, not sure, but back to the errors. Something with the way you are handling the method with line 234 is overly sensitive to any changes in the hierarchy.

Share this post


Link to post
Share on other sites

Hi,

 

This problem still exists.

I had two groups.

I deleted one probuilder object before removing it from the group, and unity was full of this errors:

 

NullReferenceException: Object reference not set to an instance of an object
ProGroups.Group.<RemoveNullOrEmpty>m__F (UnityEngine.GameObject x) (at Assets/ProCore/ProGroups/Scripts/InScene/GroupContainer.cs:35)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[unityEngine.GameObject].MoveNext ()
System.Collections.Generic.List`1[unityEngine.GameObject].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[unityEngine.GameObject]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[GameObject] (IEnumerable`1 source)
ProGroups.Group.RemoveNullOrEmpty () (at Assets/ProCore/ProGroups/Scripts/InScene/GroupContainer.cs:35)
ProGroups.GroupContainer.Clean () (at Assets/ProCore/ProGroups/Scripts/InScene/GroupContainer.cs:308)
ProGroups.ProGroups_Window.OnGUI () (at Assets/ProCore/ProGroups/Scripts/Editor/ProGroups_Window.cs:275)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

 

After that the ProGroups window crashed as soon as i opened it, and didn't show the groups, it just hang.

 

I've upgraded to the latest version (deleted the previous version first). I'm using Unity 5.3.5

I've used the menu option "Clear all groups in scene" and it seems that the errors are gone.

 

But now the ProGroups window does not open. I've deleted ProGroups, restarted Unity, re-imported it,  and nothing.

Any thoughts?

 

 

Share this post


Link to post
Share on other sites

Regarding not opening now, try resetting the window layouts in Unity (it's the button in the top right of the Unity editor).  Also make sure there aren't any persistent errors in the Console preventing ProGroups from compiling.

 

On the error, that's super strange.  I could swear that the Where function returns an empty IEnumerable and not null.  I've also been unable to reproduce this as of the latest update, so if you happen to come across a repeatable situation that emits this error please let me know.

Share this post


Link to post
Share on other sites

I've lost my saved layout by doing "Revert Factory Settings...", but ProGroups window is working now. My layout is easy to reorganize, so no problem there.

 

Probably another bug: When all this happened one of the groups was set to "not visible" (eye icon in ProGroups), and because i did the "Clear all groups in scene" those objects under this group remained "not visible", disabled in Hierarchy, with no way to enabled them. To regain access to them i had to add them to a new group, turn "visibility" off and then on, and now they are accessible again.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×