React-native-windows: 'react-native run-windows' fails with a missing dependency error on 'Installing new version of the app from layout'

Created on 6 Aug 2020  ·  3Comments  ·  Source: microsoft/react-native-windows

Environment

Run the following in your terminal and copy the results here.

  1. npx react-native -v: 4.10.1
  2. npx react-native run-windows --info:
    System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
    Memory: 5.97 GB / 15.92 GB
    Binaries:
    Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.17.3 - ~\AppData\Roamingnpm\yarn.CMD
    npm: 6.10.2 - C:\Program Files\nodejsnpm.CMD
    npmPackages:
    react: 16.11.0 => 16.11.0
    react-native: ^0.62.0-0 => 0.62.2
    react-native-windows: ^0.62.0-0 => 0.62.4
    Installed UWP SDKs:
    10.0.17763.0
    10.0.18362.0
    10.0.19041.0
  3. reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
    AllowDevelopmentWithoutDevLicense REG_DWORD 0x1
    AllowAllTrustedApps REG_DWORD 0x1

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Follow these instructions to setup a new project: https://microsoft.github.io/react-native-windows/docs/getting-started
  2. Execute 'npx react-native run-windows' to run the app.

Expected Results

Describe what you expected to happen.
A hello world app to run, which it does when running the app through VS, but exits with an error when running with 'npx react-native run-windows'


Exits with the following output:

Utilization: 100.0 Average Utilization: 100.0
√ Building Solution
√ React-Native Server already started
‼ Applying Add-AppDevPackage.ps1 workaround for VS 16.5-16.6 bug - see https://developercommunity.visualstudio.com/content/problem/1012921/uwp-packaging-generates-incompatible-certificate.html
√ Removing old version of the app
√ Enabling Developer Mode
√ Installing dependent framework packages
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict
validation.
Windows cannot install package 3721eb55-521f-4b4c-9c9d-afa239742a39_1.0.0.0_x86__1z456b647fn8a because this package
depends on a framework that could not be found. Provide the framework "Microsoft.VCLibs.140.00.Debug" published by
"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x86 processor
architecture and minimum version 14.0.27810.0, along with this package to install. The frameworks with name
"Microsoft.VCLibs.140.00.Debug" currently installed are: {M
Windows cannot install package 3721eb55-521f-4b4c-9c9d-afa239742a39_1.0.0.0_x86__1z456b647fn8a because this package
depends on a framework that could not be found. Provide the framework "Microsoft.VCLibs.140.00.Debug" published by
"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x86 processor
architecture and minimum version 14.0.27810.0, along with this package to install. The frameworks with name
"Microsoft.VCLibs.140.00.Debug" currently installed are:
{Microsoft.VCLibs.140.00.Debug_14.0.27810.0_x64__8wekyb3d8bbwe}
NOTE: For additional information, look for [ActivityId] 2c315fe2-6a11-0002-f36d-3e2c116ad601 in the Event Log or use
the command line Get-AppPackageLog -ActivityID 2c315fe2-6a11-0002-f36d-3e2c116ad601
At C:\users\mu.....\checkin\checkin\node_modules\react-native-windows\local-cli\runWindows\utils\WindowsStoreAppUtils.p
s1:183 char:5

  • Add-AppxPackage -Path $Path -Register -ForceApplicationShutdown
  • ~~~~~~~~~~~~~~~

    • CategoryInfo : WriteError: (C:\users\mu.......ppxManifest.xml:String) [Add-AppxPackage], IOException

    • FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

× Installing new version of the app from layout
× Failed to deploy: Installing new version of the app from layout

Snack, code example, screenshot, or link to a repository:

No custom code needed. It fails even with the hello world application.

Also, FYI, I tried the suggestion given in issue #5179, and while the app runs fine on Visual Studio, I still get the same error when trying to run the app using 'react-native run-windows'.

bug

All 3 comments

Thanks for filing a new bug @shoaib !
I'm not able to repro this though, even on a clean VM without the VCLibs debug package, it gets properly installed... :(
A couple of things to check:

  • There should be a file under your project with extension .appxrecipe. Does that file reference the x86 version of VCLibs.Debug (it should)
  • Do you have this file on your PC: C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs\14.0\AppX\Debug\x86\Microsoft.VCLibs.x86.Debug.14.00.appx
    If so, installing that appx and re-running run-windows should unblock you, though I don't know why you might be hitting this problem since the version of RNW you are running has the fix to pre-install the VCLibs.Debug package

Thanks for filing a new bug @shoaib !
I'm not able to repro this though, even on a clean VM without the VCLibs debug package, it gets properly installed... :(
A couple of things to check:

  • There should be a file under your project with extension .appxrecipe. Does that file reference the x86 version of VCLibs.Debug (it should)
  • Do you have this file on your PC: C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs\14.0\AppX\Debug\x86\Microsoft.VCLibs.x86.Debug.14.00.appx
    If so, installing that appx and re-running run-windows should unblock you, though I don't know why you might be hitting this problem since the version of RNW you are running has the fix to pre-install the VCLibs.Debug package

That did the trick. You rock @asklar. Surprisingly I was not able to find this information in any of my other searches. You might wanna add this somewhere in the documentation to avoid any future bugs related to this matter (or not, cuz this solution will now appear under any searches now) 😁

Thanks once again for your help!

Sounds like you're unblocked @shoaib , yay!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chai41104 picture chai41104  ·  3Comments

namrog84 picture namrog84  ·  4Comments

josephan picture josephan  ·  3Comments

tahakhozooie picture tahakhozooie  ·  4Comments

syedibrahimt picture syedibrahimt  ·  3Comments