Unity freezes when creating a new GestureRecognizer (5.5 and up)

Recently I reinstalled windows 10 on my computer. After also reinstalling Unity I noticed my application freezing whenever I hit play.

After some debugging I found out that creating a new GestureRecognizer was making Unity freeze. The play icon grays out and cpu usage drops to 0.0%. Unity will no longer respond to anything I do and I’m forced to kill it via task manager.

Here’s the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.VR.WSA.Input;

public class gest : MonoBehaviour
{
    GestureRecognizer g;

    // Use this for initialization
    void Start () {

        g = new GestureRecognizer(); 

    }
   
    // Update is called once per frame
    void Update () {
       
    }
}

Things I’ve tried to fix it from freezing:

  • Reboot Unity
  • Tried different versions of Unity
  • Rebooted windows
  • Adding .dll files from data folder of a working pc (same project, same installer, same everything and it doesn’t freeze there)
  • Reimporting all assets…

It seems like it’s not Unity related but any help would be greatly appreciated.

bump, need an answer for work…

bump

I’m having the exact same issue. For me, disabling related code for the editor and testing on the device is possible, but still really annoying. So far I tried Unity 5.5.3p2 and 5.6, neither worked. Unity log also has nothing related.

Moreover in HoloToolkit-Unity repository, this problem first mentioned in January and didn’t have a solution yet, so it doesn’t seem promising…

For the future reference; having a clean re-install (instead of build-in “reset my PC” feature) solved the problem for me.

Installing Windows 10 SDK solved the problem for me. It would be nice if Unity detects the SDK is missing.

Thank you @KarlosZafra , I think you partially helped me out of my problem.

I struggled with this problem for two days and I finally got it working.

  • Installed all versions of the Windows 10 SDK (I don’t believe its necesary to install them all but I became desperate)
  • I figured out I did not have Windows Developer settings enabled
  • My two previous steps didn’t work until I restarted my computer

An issue were created on Github which I contributed to:
https://github.com/Microsoft/HoloToolkit-Unity/issues/710

Enabling Developer settings in windows fixed the issue. Thread may now be closed, thanks @Freaking-Pingo !

Does anyone know if this has been reported to Unity as a bug? Enabling developer mode fixed this for me, but it would be nice for Unity to present instructions to the user instead of hanging.

I created a minimum repro case and reported this via the Unity Bug Reporter.

And Unity created an issue for it: https://issuetracker.unity3d.com/issues/the-editor-will-freeze-on-play-mode-enter-if-developer-mode-is-off-in-windows-and-a-gesture-recognizer-is-used