Search Unity

WSA Test Certificate file failures when project is build for UWP

Discussion in 'Windows' started by nathan_champion, Sep 16, 2020.

  1. nathan_champion

    nathan_champion

    Joined:
    Nov 16, 2017
    Posts:
    1
    Hello! I'm trying to make a UWP build for a project, but I'm running into some problems. I'm using Jenkins to build these on remote Windows machines. In the first set of tests, the project to be built had no WSATestCertificate.pfx file already existing. Here's a portion of the log generated as a result where I believe the issue is occurring:

    [B]2020-09-10 17:54:07[/B] Assertion failed on expression: 'FALSE != acquireNewContextResult'
    [B]2020-09-10 17:54:07[/B] UnityEditor.EditorUtility:WSACreateTestCertificate(String, String, String, Boolean)


    This would eventually lead to this issue below where the build would fail:

    [B]2020-09-10 17:54:07[/B] FileNotFoundException: Assets\WSATestCertificate.pfx does not exist


    This failed multiple times for this same reason. It was suggested by a colleague to use the UWP Player Settings to create the certificate file. I did so and did not specify a password. This is an internal build. However, the builds continued to fail on the remote machines with the below statements in the log:


    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(4353,5): 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. [C:\Users\jenkins\git\psd\slot-dev-mobile-noassets-unity5\Builds\WSAPlayer\test\SGSlots\SG Slots\SG Slots.vcxproj]
    [B]2020-09-15 14:10:21[/B] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(4353,5): error APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see [URL]http://go.microsoft.com/fwlink/?LinkID=241478[/URL]. [C:\Users\jenkins\git\psd\slot-dev-mobile-noassets-unity5\Builds\WSAPlayer\test\SGSlots\SG Slots\SG Slots.vcxproj]


    It seems that even not specifying a password, it still considers the file to be password protected? Does anyone have any suggestions on how I can fix this?

    Thank you for any help!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Hey, failing to create certificates can happen for various reasons. However, we greatly improved the error messages for it in 2020.2. Could you by any chance try building an empty project to UWP with Unity 2020.2 beta on the machine where "
    Assertion failed on expression: 'FALSE != acquireNewContextResult'" error gets generated?
     
  3. unity_8R3gaxreN6dMTA

    unity_8R3gaxreN6dMTA

    Joined:
    Apr 9, 2018
    Posts:
    9
    Building for UWP in 2020.2 created the certificate fine. XR Plugin Management 3.2.17 also worked fine.