Skip to content

AppX / MSIX package generated by Visual Studio in Release mode crashes at startup #3810

@qmatteoq

Description

@qmatteoq

Environment

If you are using latest version:

  1. react-native -v:

react-native-cli: 2.0.1
react-native: 0.60.6

  1. react-native run-windows --info:

System:
OS: Windows 10 10.0.18363
CPU: (4) x64 Intel(R) Core(TM) i7-6650U CPU @ 2.20GHz
Memory: 6.43 GB / 15.93 GB
Binaries:
Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD
npmPackages:
react: 16.8.6 => 16.8.6
react-native: ^0.60.0 => 0.60.6
react-native-windows: 0.60.0-vnext.95 => 0.60.0-vnext.95
rnpm-plugin-windows: ^0.3.8 => 0.3.8
Installed UWP SDKs:
10.0.17763.0
10.0.18362.0
10.0.19035.0

Then, specify:

  • Target Platform Version(s): 10.0.18362
  • Target Device(s): Desktop
  • Visual Studio Version: 2019 16.4
  • Build Configuration: Release

Steps to Reproduce

(Write your steps here:)

  1. Create a new empty React Native project.
  2. Add Windows support as per instructions here: https://github.com/microsoft/react-native-windows/blob/master/vnext/docs/ConsumingRNW.md
  3. Open the solution in the windows folder with Visual Studio
  4. Right click on the default C++ project, choose Publish -> Create app packages and start the wizard.
  5. Choose "Release" as configuration mode.
  6. Wait for the process to finish.

Expected Behavior

After having installed the AppX / MSIX package generated by Visual Studio, the application should start and run.

Actual Behavior

After having installed the AppX / MSIX package generated by Visual Studio, the application crashes at startup after the splash screen.

Reproducible Demo

You can reproduce the problem with any newly created React Native project with Windows support. You can use the following one if you need: https://github.com/qmatteoq/NavigationSample

Additional context

The problem is caused by the lack of the Bundle folder inside the MSIX package. I can see the react-native bundle command being launched during the build and, in the compilation artifacts, I can see a Bundle folder containing the React Native assets.
However, this folder is missing from the generated MSIX package and it's causing the crash at startup. If I manually unpack the MSIX package, add the Bundle folder from the compilation artifacts and pack it again, then the application doesn't crash anymore at startup after the deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions