[TIMOB-24422] Windows: Deployment fails with "violates pattern constraint of bms-resource"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-01-30T12:05:00.000+0000 |
Affected Version/s | Release 6.0.1, Release 8.0.0 |
Fix Version/s | Release 8.0.0 |
Components | Windows |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Kota Iguchi |
Created | 2017-02-22T16:25:42.000+0000 |
Updated | 2019-01-30T17:24:53.000+0000 |
Description
When attempting to install a Titanium app onto a Windows Phone 10 emulator (specifically Mobile Emulator 10.0.14393.0 WVGA 4 inch 512MB), the process fails when trying to install the library dependency:
Create a new alloy application
Build to device
[INFO] Installing dependency: Microsoft.VCLibs.x86.14.00.appx
[INFO] Project built successfully in 1m 15s 438ms
[ERROR] Failed to install app (code 2147943860): Windows App Deployment Tool
Version 10.0.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
Opening connection to device at '169.254.199.16'.
Installing app...
Disconnecting.
0x80131500 - Failed to install or update package: Unspecified error
'Microsoft Platform Extensions' violates pattern constraint of '\bms-resource:.{1,256}'.
0x80131505 - Unspecified error
'Microsoft Platform Extensions' violates pattern constraint of '\bms-resource:.{1,256}'.
0x800705B4 - Unspecified error
'Microsoft Platform Extensions' violates pattern constraint of '\bms-resource:.{1,256}'.
*Steps to reproduce;*
Note the version number of the Windows SDK/Phone: 10.0.14393.0 I think this may be a new issue specifically for this version of the SDK. If I install he app manually with winappdeploycmd.exe that works fine. I think we typically attempt to install the dependency manually ourselves before the app, and the new tooling lets you specify the dependency to install or automagically picks it up. We may just need to roll back to letting the winappdeploycmd do that?
https://github.com/appcelerator/titanium_mobile_windows/pull/958
Even after we skip installing dependencies, Jenkins still has errors with this: [PR-958/1/pipeline/42](https://jenkins.appcelerator.org/blue/organizations/jenkins/appcelerator%2Ftitanium_mobile_windows/detail/PR-958/1/pipeline/42)
[~cwilliams] I find [this thread](https://social.msdn.microsoft.com/Forums/en-US/afb81643-e84e-4df9-9533-b68d2d603cfe/uwpunable-to-deploy-uwp-app-with-winappdeploycmd-getting-error-microsoft-platform-extensions?forum=wpdevelop), maybe we could try this? {quote} I faced that problem when deploying by real IP address. After I checked the device IP by "winappdeploycmd devices" it shows 127.0.0.1 as a IP address of your phone. Then used winappdeploycmd -ip 127.0.0.1 .... and it installed without that error. {quote}
I believe [~cwilliams] already resolved this, original issue was emulator didn't properly pair the device and now it's working. Resolving this as "Won't Do".
[~kota] So I am *still* seeing this on our build machine, specifically on trying to get our windowslib library built and tested. The "TestApp10.0" we use in the unit tests there is failing to install the app intermittently on the Windows 10 emulator. I'm going off of hints like this http://stackoverflow.com/questions/29991693/cant-deploy-universal-app-to-phone-with-windows-10-mobile-tech-preview where I think we need to update the appxmanifest to specify different dependencies. I think we may need to add the .NET.CoreRuntime dependency ourselves? Still working on it here: https://jenkins.appcelerator.org/job/cli/job/windowslib/job/PR-67/
Finally found the source of the issue. The windowslib emulator.stop method works fine for Windows 8.1 emulators, but was not really stopping Windows 10 emulators (as verified in the Hyper-V manager). I have hacked it to use Stop-VM with the -TurnOff flag for now, but I need to do some more work to sniff OS version to determine if the Stop-VM powershell cmd is available (it is on Windows 10, but not stock Windows 8.1).
And, tracking down another issue that can contribute. I believe not only were we not properly shutting down emulators for Windows 10, but we're experiencing a timing issue on Windows 10 emulators using windowslib.emulator.install. I *think* that the unit test we have exposes that if you try to install an app to a Windows 10 emulator that isn't running, the windowslib code will "connect" to launch the emulator and then try to install the app, and I don't think it's waiting long enough for the install portion. We likely need to add some code to wait for the emulator to transition state after the connect call and before the install (but only for emulators!)
I have faced similar issue on Windows 10 Mobile device on the latest 6.1.x build (6.1.0.v20170502132103). For me, skipping installing dependencies solves this issue on my device. (Added
--installDependencies
flag) Would you try this [~cwilliams]? https://github.com/appcelerator/titanium_mobile_windows/pull/958TIMOB-24656 (
--skipInstallDependencies
) This only intends to fix for the deployment issue described in the ticket.[~cwilliams] Regarding the timeout issue, do you mean [this config](https://github.com/appcelerator/titanium_mobile_windows/blob/master/cli/hooks/wp-run.js#L205)? It's set to 60 sec, but I guess it's too short because it usually takes 100 sec on my laptop (Surface Pro 3) to launch/install app on the emulator. (BTW I don't know why are we using the "windows.log.timeout" for the configuration key...(?)(?))
[~kota] I'm specifically running into this issue when running windowsill's unit tests on a Windows 10 build box in our CI build. It seems that the unit test that calls windowslib.emulator.install to both start the emulator and install the test app is seeing this specific error pretty much 100% of the time. I attempted to add some code between the wptool.connect call that launches the emulator and the app install that polled the emulator status to verify it is "Running", but that seems to state it's running immediately and doesn't avoid the issue. I'm wondering if this is simply because the default checkpoint already has a debug app installed in it? (But then why do the other tests that call launch and then install the app after work nearly 100% of the time without this issue?).
I'm also seeing this issue consistently when deploying to my Windows 10 device. I haven't found a workaround yet.
[~gmathews] You've been using VS2017 right? It has a newer VCLibs dep see TIMOB-24934
[~eharris] Using
--skipInstallDependencies
didn't resolve the issue[~gmathews] Is this still the issue for you? Could you try latest release (such as 7.2.0.GA)?
I am able to reproduce this on 8.0.0 especially for an alloy app with hyperloop enabled. Interestingly I saw sometimes app is actually installed to the device even when Windows Deployment Tools errors out with this "unspecified error"...Increasing timeout & specifying
--skipInstallDependencies
didn't help.Merged to titanium_mobile master & 8_0_X Should be available in [nightly build](https://builds.appcelerator.com/#8_0_X)
appc ti sdk install --branch 8_0_X 8.0.0.v20190129074948
Related PR: https://github.com/appcelerator/windowslib/pull/87
*Closing Ticket* The fix can be found it SDK; {noformat} 8.0.0.v20190129200738 {noformat}
So my best guess here is that the VCLibs dependency is the one getting flagged as an issue here, since that app manifest contains a publisher name of "Microsoft Platform Extensions". I can't see anything wrong with that package itself personally, and I doubt MS would ship a busted app for VCLibs. So my best stab in the dark at solving this is that we're not properly setting up the dependencies. In fact, I see we do not add VCLibs to the appxmanifest of the user app as a PackageDependency(https://github.com/appcelerator/titanium_mobile_windows/blob/master/templates/build/Package.win10.appxmanifest.in.ejs#L27). This link seems most relevant: https://developercommunity.visualstudio.com/content/problem/233202/microsoftnetnativeframework20-0x80073cf3.html So a first attempt to fix this would likely be to add to the template the dependency:
The second guess is that we should not try and install the dependencies manually ourselves in the build, but just install our apps and I assume it'll pick up the dependencies properly on it's own. (https://github.com/appcelerator/titanium_mobile_windows/blob/master/cli/hooks/wp-run.js#L194-L333) I guess the quick way to test that theory is to add the dependency in the template above and then build with the
--skipInstallDependencies
flag