Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

PhoneGap build does not work for Windows appx #530

Closed
brodybits opened this issue Jul 7, 2016 · 16 comments
Closed

PhoneGap build does not work for Windows appx #530

brodybits opened this issue Jul 7, 2016 · 16 comments

Comments

@brodybits
Copy link

According to http://phonegap.com/blog/2016/04/25/windows-10-and-phonegap-cli-6_1-now-on-build/ it should be possible to build Windows 8.1/Windows Phone 8.1/Windows 10 appx on PhoneGap build.

I tried it in https://build.phonegap.com/apps/2158217 based on https://github.com/brodybits/CB-dialog-appx-8.1-phone-test which only uses the cordova-plugin-dialogs plugin but I get a build error. When I click the red Windows build error button I get the following message along with a "notify us" button:

Oh geez. Your build failed. Sorry, but a problem occurred on the build server

I already clicked this "notify us" button for other tests.

I had similar problems when I tried it with Cordova-sqite-legacy-build-support sqlite plugin for Windows Phone 8.1 and Windows 10. I am hopeful that if it works for my dialog test app then it will work with the sqlite plugin.

I noticed that issues building for Windows with the PhoneGap CLI were reported in #520 and #523. I wonder if these are related or not.

I need this to be fixed for a commercial customer. Thanks!

@brodybits
Copy link
Author

I tried dropping the windows-arch preference and it still does not build.

@brodybits brodybits changed the title PhoneGap build does not work for appx PhoneGap build does not work for Windows appx Jul 8, 2016
@brodybits
Copy link
Author

brodybits commented Jul 8, 2016

Similar issues on the PhoneGap Build forum:

I have a commercial customer waiting for this to be fixed. Thanks!

UPDATE: ongoing discussion in https://forums.adobe.com/message/8905272

@ef33zy
Copy link

ef33zy commented Jul 24, 2016

@brodybits I'm having similar issue as you using CLI-6.1.0.

When I specify
<preference name="windows-appx-target" value="8.1-phone"/>
I get this error:
CertUtil: -importPFX command FAILED: 0x80070002 (WIN32: 2 ERROR_FILE_NOT_FOUND) CertUtil: The system cannot find the file specified.

When I specify
<preference name="windows-appx-target" value="uap"/> or no preference:
I get this error:
C:\cygwin\tmp\gimlet\2149308\project\build\phone\release\anycpu\AppxManifest.xml(41,6): error APPX1404: File content does not conform to specified schema. The element 'Capabilities' in namespace 'http://schemas.microsoft.com/a... has invalid child element 'Capability' in namespace 'http://schemas.microsoft.com/a.... List of possible elements expected: 'DeviceCapabilityChoice, DeviceCapability' in namespace 'http://schemas.microsoft.com/a... as well as 'DeviceCapability' in namespace 'http://schemas.microsoft.com/a.... [C:\cygwin\tmp\gimlet\2149308\project\CordovaApp.Phone.jsproj]

I'm wondering if you've had a workaround

@ef33zy
Copy link

ef33zy commented Jul 27, 2016

@brodybits The PGB team just added support for cli-6.3.0 version to PhoneGap Build (https://twitter.com/PhoneGapBuild/status/758412620038713345).

I rebuilt my app and the error has disappeared.
You may want to give it a try.

Just have a different issue now, it's not installing the vibration plugin (cordova-plugin-vibration)

@ef33zy
Copy link

ef33zy commented Jul 28, 2016

@brodybits I think I may spoken too soon.... I hid the vibration and globalization plugins (for other errors) and this is what I'm getting now...
Building project: C:\cygwin\tmp\gimlet\2149308\project\CordovaApp.Windows10.jsproj Configuration : release Platform : anycpu C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(1854,5): warning APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. [C:\cygwin\tmp\gimlet\2149308\project\CordovaApp.Windows10.jsproj] C:\cygwin\tmp\gimlet\2149308\project\build\windows\release\anycpu\win10\AppxManifest.xml : error APPX0501: Validation error. error C00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 35, Column 6, Reason: Element '{http://schemas.microsoft.com/appx/manifest/uap/windows10}Capability' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Capabilities'. Expecting: {http://schemas.microsoft.com/appx/manifest/foundation/windows10}DeviceCapability. [C:\cygwin\tmp\gimlet\2149308\project\CordovaApp.Windows10.jsproj]

@stoffer1
Copy link

I have the same problem as well

CertUtil: -importPFX command FAILED: 0x80070002 (WIN32: 2 ERROR_FILE_NOT_FOUND)
CertUtil: The system cannot find the file specified.
my "Personal"
CertUtil: -delstore command completed successfully.

@frederikbosch
Copy link

I believe this is the same error as in #529. So this could be closed too, as there was a fix for it.

@brodybits
Copy link
Author

I will check with my customer and report if it is OK or not.

@brodybits
Copy link
Author

It works for me if I specify PGB CLI 6.3.0, UWP (Windows 10), and arm CPU arch, sample at: https://github.com/brodybits/Cordova-PGB-dialog-test-Windows10-arm

I was able to scan the QR code with my Microsoft Lumia test mobile device, install the app, run it, and get the expected native alert dialogs.

If I do not specify the CPU arch, scan the QR code, and install the app it fails silently for me, sample at: https://github.com/brodybits/Cordova-PGB-dialog-test-Windows10-anyarch

Another issue: if the app name is too long the Windows build tool fails with an error, for example: https://github.com/brodybits/Cordova-PGB-dialog-test-Windows10-anyarch/blob/master/config.xml#L3. I wish the PhoneGap CLI would catch this sooner, plan to raise this as a new issue when I get a chance.

Closing for now, I will try this with legacy-build/evcore-extbuild versions of the sqlite plugin and report the results.

@frederikbosch
Copy link

@brodybits Regarding the length of the app name: that would be something that can be catched by the schema of XML file (XSD)

@brodybits
Copy link
Author

Regarding the length of the app name: that would be something that can be catched by the schema of XML file (XSD)

Sounds good. I wonder if this would cause a problem with existing apps already working on Android/iOS?

@BarbiBimbo
Copy link

I have no idea how to read this... is it saying that ADOBE fetched the wrong plugin from NPM, or constructed an xml file incorrectly ?????

Build Date: 2017-06-24 01:25:24 +0000

PLUGIN OUTPUT

Fetching plugin "cordova-plugin-whitelist" via npm
Installing "cordova-plugin-whitelist" at "1.3.2" for windows

COMPILE OUTPUT

Building project: C:\cygwin\tmp\gimlet\2674558\project\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : x86
Patching 10 in prebuild event...
Injected base.js reference to the www/index.html
Removing /( )(<script\s+(?:type="text/javascript"\s+)?src="//Microsoft.WinJS.2.0/js/base.js">\s</script>)(\s*)/ from www/index.html
Removing /( )(<script\s+(?:type="text/javascript"\s+)?src="//Microsoft.Phone.WinJS.2.1/js/base.js">\s</script>)(\s*)/ from www/index.html

C:\cygwin\tmp\gimlet\2674558\project\build\windows\debug\x86\win10\AppxManifest.xml : error APPX0501: Validation error. error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 28, Column 80, Reason: '1.0.01.0' violates pattern constraint of '(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}'. The attribute 'Version' with value '1.0.01.0' failed to parse. [C:\cygwin\tmp\gimlet\2674558\project\CordovaApp.Windows10.jsproj]

@stoffer1
Copy link

stoffer1 commented Jun 24, 2017 via email

@BarbiBimbo
Copy link

BarbiBimbo commented Jun 24, 2017

I discovered that the message was leading in the wrong direction. It failed to properly identify to me WHICH FILE contained the error. By doing a global search on my project, I discovered that this error is caused by a -version number- in the root confg.xml which does not follow the format "version=xx.x.x.x" in my case I had "version=10.0.01.0" Notice that apparently "leading zeroes" are not allowed in any of the tuplets.

@orenagiv
Copy link

orenagiv commented Aug 8, 2017

Not sure if it's the actual solution, but for me, if I used the Publisher ID as the Common Name of the certificate, it worked (but only in the second time I tried to compile...)

windows

Also, I have the following preferences in my config.xml:

<!-- Windows Preferences -->
<preference name="windows-arch" value="x64" />
<preference name="windows-identity-name" value="xxxxxxxx.yyyyyyyyyyy" />
<preference name="windows-appx-target" value="uap" />

Note: The "xxxxxxxx.yyyyyyyyyyy" is the exact value of the identity attribute from the attached image (starts with 6DC97... in the image)

@BarbiBimbo
Copy link

BarbiBimbo commented Aug 8, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants