microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

HoloToolKit Build Window - Able to build APPX, Unable to deploy #287

Closed slammer8 closed 7 years ago

slammer8 commented 7 years ago

Issue

When building the SpatialUnderstandingExampleScene using the HoloToolKit build tool, unable to deploy on device.

Expected Result:

Deploys correctly

Actual Result:

System.ArgumentException: JSON parse error: Missing a comma or ']' after an array element.
  at (wrapper managed-to-native) UnityEngine.JsonUtility:FromJson (string,System.Type)
  at UnityEngine.JsonUtility.FromJson[AppList] (System.String json) [0x0000c] in C:\buildslave\unity\build\artifacts\generated\Metro\modules\JSONSerialize\JsonUtilityBindings.gen.cs:24 
  at HoloToolkit.Unity.BuildDeployPortal.QueryAppDetails (System.String packageFamilyName, ConnectInfo connectInfo) [0x0003c] in D:\Documents\Hololens Test Projects\SpatialTest\Assets\HoloToolkit\Build\Editor\BuildDeployPortal.cs:170 
  at HoloToolkit.Unity.BuildDeployPortal.IsAppInstalled (System.String packageFamilyName, ConnectInfo connectInfo) [0x00003] in D:\Documents\Hololens Test Projects\SpatialTest\Assets\HoloToolkit\Build\Editor\BuildDeployPortal.cs:116 
  at HoloToolkit.Unity.BuildDeployWindow.InstallAppOnDevicesList (System.String buildPath, Boolean uninstallBeforeInstall, System.String[] targetList) [0x00048] in D:\Documents\Hololens Test Projects\SpatialTest\Assets\HoloToolkit\Build\Editor\BuildDeployWindow.cs:508 
UnityEngine.Debug:LogError(Object)
HoloToolkit.Unity.BuildDeployWindow:InstallAppOnDevicesList(String, Boolean, String[]) (at Assets/HoloToolkit/Build/Editor/BuildDeployWindow.cs:523)
HoloToolkit.Unity.<OnGUI>c__AnonStorey1:<>m__0() (at Assets/HoloToolkit/Build/Editor/BuildDeployWindow.cs:333)
UnityEditor.EditorApplication:Internal_CallDelayFunctions()

Current Workaround: Use device portal to manually install app and dependencies.

Platform

Unity 5.5.0b7 Win10 Pro V 1607 B 14393.321

darax commented 7 years ago

I was able to repro, but the device portal also failed to install the packages. Once I got the device portal to work, I was no longer able to repro.

slammer8 commented 7 years ago

Can you clarify? I'm able to install using the device portal.

darax commented 7 years ago

After you've installed with the device portal, have you tried installing from the toolkit build window again?

slammer8 commented 7 years ago

Yep, same error.

darax commented 7 years ago

what build of unity are you running?

slammer8 commented 7 years ago

5.5.0b7 Personal

darax commented 7 years ago

okay, Unity changed their JSON libs in 5.5. I'll try to repro from 5.5

slammer8 commented 7 years ago

Thanks!

darax commented 7 years ago

hrm... 5.5 is still working. Can someone else repro?

NeerajW commented 7 years ago

I tried from Unity Beta 5.5.0b7 with a clean HoloToolkit-Unity App folder. I deleted all Library, UWP, App folder stuff I had from earlier.

It worked without any issues.

darax commented 7 years ago

Looking at the stack, the script is trying to get the list of apps on the HoloLens. I'm wondering if there is an app installed on your HoloLens that has a character which upsets the JSON parsing.

in HoloToolkit-Unity\Assets\HoloToolkit\Build\Editor\BuildDeployPortal.cs can you modify QueryAppDetails to debug.log the appListJSON? It might be really long, in which case a File.WriteAllText("C:\temp\output.txt", appListJSON); would be better.

slammer8 commented 7 years ago

output.txt

I've attached the output. I've validated it with JSONLint and it seems good.

darax commented 7 years ago

cool, Unity 5.5 doesn't like it. :) Unity 5.4 is okay. I'll see if I can find a way to make 5.5 happy.

slammer8 commented 7 years ago

Thanks!

Best,

Sam

On Tue, Oct 18, 2016 at 1:32 PM, Patrick Cook notifications@github.com wrote:

cool, Unity 5.5 doesn't like it. :) Unity 5.4 is okay. I'll see if I can find a way to make 5.5 happy.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/HoloToolkit-Unity/issues/287#issuecomment-254580821, or mute the thread https://github.com/notifications/unsubscribe-auth/AHCFTDjwulRuYbd0l0C_4I9wFUa095GAks5q1QKmgaJpZM4KY_-F .

darax commented 7 years ago

Not sure what the workaround is yet, but this app's name is confusing unity's JSON parser in 5.5.

SpaceTrackerâ„¢ (Holographic) BINARYSPACE.SpaceTrackerHolographic BINARYSPACE.SpaceTrackerHolographic_0.2.2.0_x86__m2n15m7j6eax2 3 BINARYSPACE.SpaceTrackerHolographic_m2n15m7j6eax2!App CN=54E260E2-8F4A-4499-B49D-A5A8ECEB1172 UnityEngine.Debug:LogFormat(String, Object[]) quickscript:Start() (at Assets/quickscript.cs:31)

slammer8 commented 7 years ago

Thanks for figuring that out. After I uninstalled the app, I was able to deploy correctly.

Maybe because the app title has the (TM) symbol?