Search Unity

Unable to run/build UWP app on PC.

Discussion in 'Windows' started by WardPeeters, Jul 28, 2017.

  1. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25
    Trying to build from Unity to windows 10 pc, getting the following errors:

    Unity version 5.6.0f3

    Visual studio version: Community 2017 / version 15.1 (26403.7) release

    Error when I build using the build settings window:

    Exception: Failed to locate C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\IDE\devenv.com
    ApplicationLauncherImpl.GetVSDevEnvPath (System.String vsEnvVariable) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:456)
    ApplicationLauncherImpl.RunVS2015 (System.String args, IDictionary`2 environmentVariables) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:404)
    ApplicationLauncherImpl.RegisterLayoutOnLocalMachineUsingVS2015 () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:317)
    ApplicationLauncherImpl.RegisterLayout () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:244)
    ApplicationLauncherImpl.Run () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:265)
    ApplicationLauncher.BuildAndRunOnSingle (BuildLaunchPlayerArgs args, WSASDK wsaSDK, WSABuildAndRunDeployTarget deployTarget) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:64)
    ApplicationLauncher.BuildAndRun (BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ApplicationLauncher.cs:50)
    UnityEditor.WSA.BuildPostprocessor.LaunchPlayer (BuildLaunchPlayerArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:122)
    UnityEditor.PostprocessBuildPlayer.Launch (BuildTargetGroup targetGroup, BuildTarget target, System.String path, System.String productName, BuildOptions options) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:150)
    UnityEditor.HostView:OnGUI()

    AND

    Exception: Failed to locate C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\IDE\devenv.com

    The build settings:

    Windows store
    sdk: Universal 10
    target device: Any device
    build type: D3D
    uwp Sdk: latest
    build and run:local machine

    The project has the Holotoolkit imported although this scene should not on the PC (Its for using the holotoolkit sharing service between PC and Hololens) When I use the holotoolkit build window the solution builds perfectly. But when I run the project after buidling in VS I get this error in VS:

    BadImageFormatException: ... (Exception from HRESULT: 0x8007000B)

    Settings in the VS build:

    Debug / x86 / Local Machine
     
  2. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25
    I was able to build it in unity using the player settings window by avoiding the Build and Run method and using the build method.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Build & Run with VS2017 wasn't functional until 5.6.2f1. You could update your Unity installation if you want to use that option.
     
  4. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25
    I was able to create the visual studio solution but I got error when I try to build it there.

    When I build for x86 - local machine, I get this error in the console when the app is started:
    BadImageFormatException: ... (Exception from HRESULT: 0x8007000B)

    When I build for x64 - local machine, I get this error when its failing to build:
    Project-Infrared-master\Builds\Hololens-Sharing-Tx\Plugins\x64\PlaneFinding.dll" because it was not found.

    I cant set my platform target to any CPU.

    Visual studio version: Community 2017 / version 15.1 (26403.7) release
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Is PlaneFinding.dll a library in your project? Is it specifically compiled for UWP? Can you show me its plugin inspector settings?
     
  6. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25

    Attached Files:

  7. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25
    In this project there is a scene for the Hololens and a scene for on the PC because on the PC its connected to the Kinect. I have build for Hololens before but not for PC which is giving me the problems. On the hololens I build it using the x86 settings in Visual studio which works for me. But on PC building on x86 gives me the (Exception from HRESULT: 0x8007000B) error.
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    In that the only PlaneFinding.dll in your project? That one should not be included to UWP builds at all.
     
  9. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25
    There are 3 PlaneFinding.dll in my project. The one in the WSA/x86/ folder is the active one. (picture added)

    The error is not making sense to me:
    Severity Code Description Project File Line Suppression State
    Error Could not copy the file "\Project-Infrared-master\Hololens-Sharing-Tx\Hololens-Sharing-Tx\Plugins\x64\PlaneFinding.dll" because it was not found.

    It seems like he looks for the PlaneFinding.dll in the sharing folder but that dll is in the spatial mapping folder. (See files picture)

    Btw I am able to build this on the hololens but not on pc. Should I use x64 or x86 for pc in the visual studio build settings?
     

    Attached Files:

  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Can you send me that DLL through PM? It could be something wrong with it if you're getting bad image exception.

    You can use both x86 and x64 for PC.

    That error you're getting (not finding x64 DLL) is a known issue: Unity currently assumes that you have same DLLs for all CPU architectures, and tries copying the DLLs even if they don't exist for particular CPU architecture (in this case x64). We plan on addressing this, but today the only workaround I can suggest is to make sure that you have DLLs for both x86 and x64 in your project.
     
  11. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25
    I think I send the PM , I dont know if you got it. First time I am using the conversation system on the forums.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yeah I got it. It's weird, the DLL seems fine. I seem to be able to call it just fine. Are you sure that exact DLL gets used when building for UWP?
     
  13. WardPeeters

    WardPeeters

    Joined:
    Mar 19, 2015
    Posts:
    25
    I copied the dll into the plugins folder of the solution and that worked for me.
    Thanks for your time.