Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Scripts not executing in UWP

Discussion in 'Windows' started by Deleted User, Aug 23, 2017.

  1. Deleted User

    Deleted User

    Guest

    Unity 2017.2.0b8 (also tried 2017.1)
    Visual Studio 2017 15.3.2
    Backend: .NET. (cannot compile with IL2CPP)

    HoloLens/UWP project builds from Unity without errors. The Visual Studio project created from Unity also builds and deploys without errors. However, any of the scripts attached to GameObjects do not initialize/execute. The scripts do execute in the Editor.
     
    Last edited by a moderator: Aug 23, 2017
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    I assume this only happens in your specific project - empty projects are not affected?
     
  3. Deleted User

    Deleted User

    Guest

    I've tried wiping and recreating all temp files (Library, Packages, ProjectSettings, Visual Studio files, etc) on my project. I just verified with an empty project, same thing.

    Actually, I just noticed that it doesn't load anything (not even any assets). The HoloLens window turns black/transparent, and disappears. Normally, when you do the "bloom" on HoloLens, the window is white.

    CPU and Memory usage also flattens...which means its just dead and not doing anything.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    Does the same thing happen when you run on local machine? That is usually easier to troubleshoot.

    I assume you see the skybox?
     
  5. Deleted User

    Deleted User

    Guest

    In the Editor, it runs fine. If I run/deploy the UWP project to my local Windows 10 machine, it crashes with unhandled win32 exception.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    What kind of exception is it? Do you have a callstack?
     
  7. Deleted User

    Deleted User

    Guest

    Difficult to get the call stack. I get the following error in debug mode. It doesnt help even if click OK launch a new debugger.
    UnityError.png
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    Go to project properties in VS -> Debug tab -> set debugger type to "mixed". That will allow you to see native callstacks.
     
  9. Deleted User

    Deleted User

    Guest

    From "m_AppCallbacks.SetBridge(m_Bridge)":
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x072FB920.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x072FB920.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x072FB920.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x072FB920.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

    From KernelBase.dll:
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: Cn::XH at memory location 0x072FE4FC.

    From "m_AppCallbacks.Run()":
    onecoreuap\drivers\mobilepc\sensors\convergence\services\broker\client\simpledeviceorientationrpcclient.cpp(252)\Windows.Devices.Sensors.dll!6A45C538: (caller: 6A45B883) Exception(1) tid(1694) 8007139F The group or resource is not in the correct state to perform the requested operation.
    Exception thrown at 0x77152482 in ABC.exe: Microsoft C++ exception: wil::ResultException at memory location 0x072FDD90.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    Continue past this one. It's not an unhandled exception. And I need the call stack, not the contents of the VS output window.
     
  11. dcolwell634

    dcolwell634

    Joined:
    Mar 10, 2013
    Posts:
    1
    I get the same thing and have been stuck on this for a few days now. Would be great to hear what the solution is.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    Can't give you a solution without knowing what the problem is. Using a debugger is the easiest way to find that out.
     
  13. Deleted User

    Deleted User

    Guest

    Those are the exceptions that get thrown when I debug it in HoloLens....no unhandled exception in HoloLens. That only exists if I run it on a Windows 10 PC. That unhandled error seems to related to Spatial Map...which PC obviously is missing.

    On HoloLens, it keeps running. Here's the last of the lines from VS output:

    [0.144195 / 108.345234] - HolographicView::OnCoreWindowSizeChanged event - (853, 480)
    [0.013397 / 108.358631] - OnWindowActivated event - Deactivated.
    [0.019887 / 108.378518] - OnVisibilityChanged event - Hidden.
    [0.019616 / 108.398134] - First level loaded
    [0.178667 / 108.576802] - HolographicView::OnWindowVisibilityChanged event - 1
    [0.001764 / 108.578566] - HolographicView::OnWindowActivated event CodeActivated
    [0.082528 / 108.661094] - PerformUpdateAndRender started
    The thread 0x1104 has exited with code 0 (0x0).
    The thread 0x1024 has exited with code 0 (0x0).
    The thread 0x7d8 has exited with code 0 (0x0).
    The thread 0xb20 has exited with code 0 (0x0).
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    Do you have a callstack for that spatial map exception? We shouldn't crash just because you're not running on hololens.

    If you pause at that point on HoloLens (where stuff just stops happening) - what callstack can you see?
     
  15. Deleted User

    Deleted User

    Guest

    There is no stuff happening. I turned the Unity splash back on, and even that doesn't show. So its even before that. Its hard to know when it crashes. But here is the HoloLens call stack at the last exception (Microsoft C++ exception: wil::ResultException):

    KernelBase.dll!77682522()
    [Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
    ucrtbase.dll!773994c2()
    Windows.Devices.Sensors.dll!655f09cd()
    Windows.Devices.Sensors.dll!655fb83a()
    [Managed to Native Transition]
    > ABC.exe!ABC.App.Run() Line 68
    [Native to Managed Transition]
    twinapi.appcore.dll!7305a96d()
    twinapi.appcore.dll!730779cd()
    SHCore.dll!7442291d()
    ntdll.dll!779f9b52()
    ntdll.dll!779f9b12()


    Win10 PC, the last exception:

    VS output:


    [0.599928 / 63.290879] - First level loaded
    Assertion failed on expression: 'pCoordinateSystem'

    (Filename: C:\buildslave\unity\build\Runtime/VR/HoloLens/SpatialMapping/SurfaceObserver.cpp Line: 540)


    ABC.exe has triggered a breakpoint.

    You are calling into spatial mapping system too early!

    (Filename: C:\buildslave\unity\build\Runtime/VR/HoloLens/SpatialMapping/SpatialMappingSystem.cpp Line: 72)


    ABC.exe has triggered a breakpoint.

    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\imagehlp.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\wintrust.dll'
    The thread 0x366c has exited with code 0 (0x0).
    The thread 0x111c has exited with code 0 (0x0).
    The thread 0x412c has exited with code 0 (0x0).
    The thread 0x4088 has exited with code 0 (0x0).
    The thread 0x217c has exited with code 0 (0x0).
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\CryptoWinRT.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\Windows.Devices.Sensors.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\Windows.Shell.ServiceHostBuilder.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\Clipc.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\Windows.System.Profile.SystemId.dll'
    Exception thrown at 0x0A4A9C59 (UnityPlayer.dll) in ABC.exe: 0xC0000005: Access violation reading location 0x00000000.

    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\OneCoreCommonProxyStub.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\Windows.ApplicationModel.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\Windows.System.Profile.HardwareId.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\DefaultDeviceManager.dll'
    'ABC.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\DDORes.dll'
    'ABC.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.Shell.ServiceHostBuilder.dll'. Cannot find or open the PDB file.
    Exception thrown: 'System.AccessViolationException' in UnityEngineProxy.dll
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    Exception thrown at 0x76EFB802 (KernelBase.dll) in ABC.exe: 0x40080201: WinRT originate error (parameters: 0x8004006A, 0x0000001A, 0x0F77F2C0).

    Exception thrown at 0x76EFB802 (KernelBase.dll) in ABC.exe: 0x40080201: WinRT originate error (parameters: 0x8004006A, 0x0000001A, 0x0F77F1E8).

    An unhandled exception of type 'System.AccessViolationException' occurred in UnityEngineProxy.dll
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


    Call stack when the memory violation is thrown:

    > ntdll.dll!77d41d3c()
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
    KernelBase.dll!76ef8839()
    ntdll.dll!77d422fc()
    ntdll.dll!77d56202()
    ntdll.dll!77d561d4()
    ntdll.dll!77d33065()
    ntdll.dll!77d44166()
    ntdll.dll!77d44166()
    UnityEngineDelegates.dll!1e7bcae1()
    [Managed to Native Transition]
    UnityEngineProxy.dll!UnityEngineProxy.InternalCalls.SurfaceObserver_CUSTOM_INTERNAL_CALL_Internal_SetVolumeAsSphere(object self, System.IntPtr observer, System.IntPtr origin, float radiusMeters)
    UnityEngine.VRModule.dll!UnityEngine.XR.WSA.SurfaceObserver.INTERNAL_CALL_Internal_SetVolumeAsSphere(UnityEngine.XR.WSA.SurfaceObserver self, System.IntPtr observer, ref UnityEngine.Vector3 origin, float radiusMeters)
    UnityEngine.HoloLens.dll!UnityEngine.XR.WSA.SpatialMappingBase.UpdatePosition() Line 356
    UnityEngine.HoloLens.dll!UnityEngine.XR.WSA.SpatialMappingBase.Start() Line 208
    UnityEngine.HoloLens.dll!UnityEngine.XR.WSA.SpatialMappingBase.$Invoke60Start(long instance, long* args)
    UnityEngine.CoreModule.dll!UnityEngine.Internal.$MethodUtility.InvokeMethod(long instance, long* args, System.IntPtr method)
    [Native to Managed Transition]
    UnityPlayer.dll!0889c894()
    UnityPlayer.dll!088bdc74()
    UnityPlayer.dll!089204ce()
    UnityPlayer.dll!06ea7bc0()
    UnityPlayer.dll!088d2046()
    UnityPlayer.dll!088ce099()
    UnityPlayer.dll!088dd197()
    UnityPlayer.dll!088d14b3()
    UnityPlayer.dll!073ce225()
    UnityPlayer.dll!08073ee6()
    UnityPlayer.dll!080696c7()
    UnityPlayer.dll!08a758af()
    UnityPlayer.dll!08a08938()
    UnityPlayer.dll!08a04bbe()
    UnityPlayer.dll!08a04a3c()
    UnityPlayer.dll!08bc9364()
    UnityPlayer.dll!08bccf52()
    UnityPlayer.dll!08bcd1d4()
    UnityPlayer.dll!08bd4372()
    threadpoolwinrt.dll!77e65cbf()
    threadpoolwinrt.dll!77e63b36()
    kernel32.dll!757d8744()
    ntdll.dll!77d3582d()
    ntdll.dll!77d357fd()
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    We'll need a bug report for that PC issue. It definitely should not be happening.

    As for HoloLens: could you pause the execution when it gets stuck, then in VS click Debug -> Save Dump As, and send me the resulting file?
     
  17. Deleted User

    Deleted User

    Guest

    Looks like this a known issue. From 2017.2.0b9 release notes:

    "XR: Windows Mixed Reality usage on b7 results in hangs and black screens at start-up. This has been fixed in b8 for VR HMDs, but is still an issue for HoloLens"
     
  18. Creatovi

    Creatovi

    Joined:
    Sep 4, 2015
    Posts:
    3
    Try update VS to 15.3.2 -> 15.3.3, it works here on my PC (with Unity 2017.1.0p5).
     
  19. Industry4O

    Industry4O

    Joined:
    Oct 30, 2018
    Posts:
    15
    Any updates about "You are calling into spatial mapping system too early!"? I get the same error.

    What a mess "developing" for hololens!
     
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
    aman_unity417 likes this.
  21. aman_unity417

    aman_unity417

    Joined:
    Aug 2, 2018
    Posts:
    2
    I have same problem
    callstack.png error.png
     
  22. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,029
unityunity