Search Unity

BUG! Unity Exception" Destroy ???

Discussion in 'VR' started by TerraSame1, Dec 31, 2019.

  1. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    Hello...
    If anyone has experienced this, Please assist, Thanks!

    While working with the HoloLens and the Odyssey HMD, I have run into a very persistent Exception. Where upon switching to a new scene I get the exception each time. Then after 4 or 5 scene switches there is a major crash.
    I am creating numerous Scenes where each Scene has an interactive button that launches a next Scene. Upon launching a new Scene from a launched Scene, or for that matter, switching from any Scene to another Scene, I get a nasty Development Console message saying:
    ______________________________________________________________________
    Unity Exception" Destroy can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers instead move initialization code to the Awake or Start function.
    ______________________________________________________________________
    So that's it ! Is it me? Maybe Unity? Or could it be the MRTK system?

    I get this nasty situation no mater the project such as if I start a simple project and compile, then fire up and switch a scene I always get this issue.

    I have attached to this message the "Player Log" file, where you can see all is well until I switch a scene, I do it a few times then you will see the crash at the end. According to the Player Log, (we believe) this looks to to have something to do with - Speech.DictationRecognizer.Dispose ???

    To reproduce:
    Simply fire up the Hub Example, compile and launch. Switch to a few different scenes then check your Player Log.

    My setup:
    - This occurs from Unity Version 2019.1.14f1 to the newest, that I am presently using, 2019.2.17f1
    - Microsoft.MixedReality.Toolkit.Unity.Examples.2.2.0.unitypackage

    Target platforms:
    - HoloLens
    - WMR immersive - Samsung Odyssey

    Also, I have researched on the www and found others who have wrestled with this exception.
    For example:
    https://forum.unity.com/threads/loa...-main-thread-error-on-changing-scenes.382574/

    Any advice as to a way to terminate this bug will be greatly appreciated...
    I look forward to being enlightened and if anything else is requested of me I will be most eager to respond.
    Thanks, Paul

    paul@terrasame.com
    www.terrasame.com
     

    Attached Files:

    JasonCostanza likes this.
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Sounds like a nuisance you and others can benefit from us taking a look. Can you file a new issue from the editor? Feel free to drop the issue number here and I'll make sure we get to it soon
     
    TerraSame1 likes this.
  3. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    Hello Jason, I sure appreciate your getting involved with this issue. Darn nasty ole bug we have here...
    I have done as you suggested and filed a Bug Report through my Editor.
    (Case 1210214) BUG! Unity Exception" Destroy
    One point I missed in the Bug report that maybe you could pass along.
    Since I originally posted this Bug thread, I of course have been looking for either an answer or a work around.
    The news is that I have re-created the entire project by integrating it into the wonderful MRTK HUB Example.
    Good and bad news... Good first...The new Hub Example project does not crash or call the Unity exception running through the Samsung Odyssey but, Bad News- through the HoloLens, the bug still remains...
    I thank you for your help with this :)
    If I can help in any other way, please call on me...
    Regards
    Paul
     
    JasonCostanza likes this.
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Thank you so much for reporting this, we'll take a look and post here or email you with any additional questions.
     
  5. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    Much obliged Jason!
    I am always available...
    Please don't hesitate...
    :)
     
  6. dieghobonilla

    dieghobonilla

    Joined:
    Sep 4, 2019
    Posts:
    6
    Any update about this @JasonCostanza? I keep getting the same when I change scenes using 2019.4 LTS and MRTK 2.4, both scenes that I am testing contains just the default MRTK game objects and a world space canvas with a UI button, the scene change happens on button click
     
    Last edited: Jul 1, 2020
  7. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Hello sorry I've been away from the forums for a couple weeks. Can you file a bug report with an attached repro project? Our last bug never got a project and it was closed as our QA team didn't have enough information to reproduce the issue.
     
  8. Alibt_sy

    Alibt_sy

    Joined:
    Nov 6, 2019
    Posts:
    5
    I also encountered this problem when jumping the scene of Hololens. May I ask how to solve this problem?
     
  9. Alibt_sy

    Alibt_sy

    Joined:
    Nov 6, 2019
    Posts:
    5
    I wonder if you have solved this problem. I saw his scene jump in Vuforia's Hololens and it seems that there is no such problem. If you have solved this problem, I hope you can reply to me.
    I wonder if you have solved this problem. I saw his scene jump in Vuforia's Hololens and it seems that there is no such problem. If you have solved this problem, I hope you can reply to me.

    My email address: 962675641@qq.com