react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

0.73.4 C# Template app crashes when option "--experimentalNuGetDependency true" is used

Open AlexDimitriadis opened this issue 1 year ago • 1 comments
trafficstars

Problem Description

I initialized a new React Native Windows App using C# and the react-native-windows NuGet packages in order to minimize the build time. The application builds without any issue but crashes after a couple of seconds. The exception is the following:

Exception thrown at 0x0000000000000000 in CSAppNuget.exe: 0xC0000005: Access violation executing location 

And the call stack:

Microsoft.ReactNative.dll!Microsoft::ReactNative::`anonymous namespace'::initHermesApi() Line 55 at D:\a\_work\1\s\vnext\Shared\HermesRuntimeHolder.cpp(55)

On output window I get this:

ERROR: Native images generated against multiple versions of assembly Microsoft.UI.Xaml. Exception thrown at 0x00007FF99948CF19 in CSAppNuget.exe: Microsoft C++ exception: EEMessageException at memory location 0x000000B4E82FA030.

Should I try using Chakra instead of Hermes? I also tried initializing the app without the --experimentalNuGetDependency true option and it runs normally.

Steps To Reproduce

1.npx react-native init CSAppNuget --version latest 2.cd CSAppNuget 3.npx react-native-windows-init --language cs --experimentalNuGetDependency true --version 0.73.4 --overwrite 4.yarn windows

Expected Results

No response

CLI version

12.3.2

Environment

System:
  OS: Windows 10 10.0.19045
  CPU: (2) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  Memory: 3.59 GB / 10.28 GB
Binaries:
  Node:
    version: 18.12.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.21
    path: C:\Program Files\nodejs\yarn.CMD
  npm:
    version: 8.19.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.17763.0
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-231.9392.1.2311.11076708
  Visual Studio:
    - 17.8.34511.84 (Visual Studio Community 2022)
    - 16.11.31829.152 (Visual Studio Professional 2019)
Languages:
  Java:
    version: 11.0.2
    path: C:\Users\user\AppData\Local\jdk-11.0.2\bin\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.4
    wanted: ^0.73.4
  react-native-windows:
    installed: 0.73.4
    wanted: 0.73.4
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

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

No response

AlexDimitriadis avatar Feb 07 '24 11:02 AlexDimitriadis

Should I try using Chakra instead of Hermes?

As far as something to try, you can. Hermes is our default test case now though.

We have testing for CLI new projects on nugets, but those tests target an exact version (e.g. 0.73.0) so perhaps there's been a regression here. We need to try validation against the more recent version.

chrisglein avatar Feb 08 '24 19:02 chrisglein

I have confirmed the repro for C# apps, the code crashes when trying to set up the Hermes Inspector. See if its repros with C++ apps too.

jonthysell avatar Mar 28 '24 21:03 jonthysell

It does not repro in the C++ app with the experimental nuget, it launches and uses Hermes just fine.

jonthysell avatar Mar 28 '24 22:03 jonthysell