Search Unity

Confusing error in Visual Studio trying to build to WSA (phone)

Discussion in 'Windows' started by christougher, Sep 22, 2017.

  1. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Hi, tried to port my game over to WSA. Freshly built the project and opened the solution in Visual Studio, attempts to build to device result in this oddness:
    Error C1083
    1>D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props (31,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\Il2CppOutputProject.vcxproj]
    This leads to more errors including
    Error C1083 Cannot open include file: 'Shlobj.h': No such file or directory

    Error MSB3073 The command ""D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=ARMv7 -configuration=Release -platform=winrt -outputpath="D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\\build\bin\ARM\Release\GameAssembly.dll" --data-folder="D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\\build\bin\ARM\Release\\" -cachedirectory="D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\\build\obj\il2cppOutputProject\ARM\Release\\" -generatedcppdir="D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=Unity -verbose --map-file-parser="D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766.


    Any ideas anyone? How do I fix this build authoring error? Am I missing some first step to setting up VS? Thx.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  3. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Thanks so much for pointing me in the right direction. Some parts of the Win 10 SDK were indeed not installed. I can now successfully build and deploy to a test device, but when I try to Create App Package to upload I get these two errors in regards to the WSATestCertificate.pfx that was generated in Unity:

    Error APPX0105 Cannot import the key file 'WSATestCertificate.pfx'. The key file may be password protected. To correct this, try to import the certificate manually into the current user’s personal certificate store. Polygon Gladiator D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 2705

    Error APPX0107 The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. Polygon Gladiator D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 2705

    I've generated a new one, both with and without passwords... not sure how to go about importing it into the personal certificate store.

    Edit....
    followed some instructions here:
    https://msdn.microsoft.com/en-us/library/windows/apps/br230260(v=vs.110).aspx
    made a new cert... looks like it's working so far :)
     
    Last edited: Sep 23, 2017
  4. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Ok... not sure what is going on or why it's happening but instead of being able to build to the device (with the green 'play' icon in the toolbar) it now only shows debugging options such as "remote windows debugging." Any ideas on why this would be? I havn't really changed any of the Unity build settings...
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Do you have ARM architecture selected in VS by any chance? You can only run x86 and x64 apps on local machine. To deploy to phone, you need to use ARM and for that you can use either "Remote machine" or "Device" deploy option in VS.

    If I misunderstood your question, please post a screenshot of what you're seeing.
     
  6. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Yes it is set to ARM still. It's very bizarre. I cannot get it to show "remote machine" or "device" any more even if I try targeting x86 or x64, I've tried uninstalling parts of VS then reinstalling, deleting the solution and rebuilding from unity... I'm not sure why I can't build and deploy any more. I can build from the build menu but not deploy
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Can you show a screenshot of what you're seeing?
     
  8. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558


    I still get this warning as well...

    1>D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props (31,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\Il2CppOutputProject.vcxproj]
     
    Last edited: Sep 26, 2017
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    You can ignore that warning, it's harmless.

    If you click on this little arrow:

    upload_2017-9-26_12-31-35.png

    You should get a drop down menu with choices where to deploy the application.
     
  10. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    right, that's how it always worked before, but all it shows is different debugger options...
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    What do you mean? So if you click that, and then select "Device", deploying to phone doesn't work through it?
     
  12. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    What I've been saying is that the "Device" and "local machine" options simply aren't there to pick. I can't see them. They aren't grayed out, they aren't disabled, they simply aren't there but I have a plethora of remote debugging options... five of them. Sorry, I should have had a screen shot showing the dropdown menu to clarify. Either way I'm in the process of un/reinstalling Visual Studios 2017 as I type as I simply couldn't figure it out...

    I really appreciate your help though! Hopefully reinstalling and rebuilding the project afresh from Unity will be the ticket to get it back to normal...
     
  13. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Last edited: Sep 28, 2017
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Ugh, I see what's wrong. For some reason, the wrong startup project is selected. I don't know how you got into that state, but to get out of it, right click on "Polygon Gladiator" and click "Set this as startup project". The reason it's showing you this is that it thinks you're trying to run Il2CppOutputProject, which actually outputs a .dll (and which obviously you cannot run).
     
  15. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Wow. Just wow. 1 second fix. Amazing lol. Thanks a while lot.