Hello Guest

Author Topic: MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but  (Read 2933 times)

lich

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
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
« Last Edit: March 14, 2013, 03:13:59 PM by lich »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 8295
    • View Profile
What happens if you shut down Unity, delete the index, and restart Unity again?

smith666

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
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..

smith666

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
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.


« Last Edit: March 14, 2013, 10:30:26 PM by smith666 »

hima

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
This happened to me as well. Hopefully this will be fixed soon!

m4ko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 75
    • View Profile
Same here. Even happens in a fresh/empty project.

Create Project
Import tk2d
Import 1 PNG
Create SpriteCollection
Commit -> The aforementioned exception comes up

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 8295
    • View Profile
Yeah managed to reproduce it.
Really annoying as it was working in the last 4.1 beta...

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 8295
    • View Profile
Working on a fix now.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 8295
    • View Profile
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.

oguztecimer

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 8295
    • View Profile
@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.

oguztecimer

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
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.

oguztecimer

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Ok i am registered now. Thanks again for the amazing speed.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 8295
    • View Profile
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.

lich

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
i'm waiting on my membership so i can get this over with.
thank you.