2D Toolkit Forum

2D Toolkit => Support => Topic started by: lich on March 14, 2013, 10:07:57 pm

Title: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: lich on March 14, 2013, 10:07:57 pm
I've updated unity to 4.1 and i am getting this exception
MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
tk2dEditorUtility.CreateIndex () (at Assets/TK2DROOT/tk2d/Editor/tk2dEditorUtility.cs:215)
tk2dEditorUtility.RebuildIndex () (at Assets/TK2DROOT/tk2d/Editor/tk2dEditorUtility.cs:60)


i can't use anything from the plugin because of this.
i get the same exception when rebuilding index
i have the latest 2D toolkit 1.91 final
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: unikronsoftware on March 14, 2013, 10:19:44 pm
What happens if you shut down Unity, delete the index, and restart Unity again?
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: smith666 on March 15, 2013, 05:05:24 am
This happened to me too.  Same version of Unity & 2D Toolkit;  when I click on a sprite in the scene it performs a "Rebuilding Index" over and over ... like in a loop and sometimes it does it a 2 or 3 times and then gives me the MissingReferenceException error above. I'll try deleting the index as you recommended and report back..
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: smith666 on March 15, 2013, 05:14:24 am
Searching in the folder reveals "tk2dIndex" is a C sharp file... I'm assuming not to delete that... My guess is that  "-tk2d.asset" is the index file...?   Anyways my folder doesn't have one; the back up I made before the 4.1 upgrade does; perhaps that's why it goes into a rebuild loop?  I tried installing 1.92 beta and still having issues... I'll try to install from the unity store one more time then I guess I'll have to go back to 4.0. :(

UPDATE 1:

It appears if I manually rebuild the index it'll delete the "-tk2d.asset" file, throw the exception ... and then complains it can't access it because it's destroyed.  (haha).  Another one isn't generated so now the project is left without an index file that can no longer be generated.  I manually copied the index file from my back up which is fine until I add something and it goes to Rebuild the Index again.

UPDATE 2:

Re-installed Unity 4.0.1f2 and so far everything appears to be running normally.  It generates a new index file without exceptions.


Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: hima on March 15, 2013, 07:39:12 am
This happened to me as well. Hopefully this will be fixed soon!
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: m4ko on March 15, 2013, 09:37:08 am
Same here. Even happens in a fresh/empty project.

Create Project
Import tk2d
Import 1 PNG
Create SpriteCollection
Commit -> The aforementioned exception comes up
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: unikronsoftware on March 15, 2013, 09:51:08 am
Yeah managed to reproduce it.
Really annoying as it was working in the last 4.1 beta...
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: unikronsoftware on March 15, 2013, 09:51:29 am
Working on a fix now.
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: unikronsoftware on March 15, 2013, 10:14:41 am
And... I have a fix.
I'm testing a bunch of stuff to make sure everything works, and a patch will be ready shortly for both 1.91 & 1.92.
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: oguztecimer on March 15, 2013, 05:08:49 pm
Hello i just bought 2D Toolkit today but couldnt make it work because of this problem. I cant wait to start with my project and i know sometimes it can take a while to make patches appy on unity asset store. So if there is a way to fix this problem without applying a patch i would really like to learn it. Thank you,
Oguz Tecimer
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: unikronsoftware on March 15, 2013, 06:09:20 pm
@oguztecimer - Register your copy following instructions here:
http://unikronsoftware.com/2dtoolkit/forum/index.php?index.php/topic,34.0.html

and you should then be able to download releases from the forum.
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: oguztecimer on March 15, 2013, 06:20:37 pm
Oh i havent realized that you already published the patch on forums. I already attemped to register my copy and waiting to get approved.
Thanks a lot.
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: oguztecimer on March 15, 2013, 06:22:58 pm
Ok i am registered now. Thanks again for the amazing speed.
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: unikronsoftware on March 15, 2013, 06:25:04 pm
That bug caught me off guard - I usually keep on top of the Unity beta releases, making sure things haven't broken. I never saw this one until it was too late, though.
Title: Re: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but
Post by: lich on March 15, 2013, 08:35:39 pm
i'm waiting on my membership so i can get this over with.
thank you.