microsoft / microsoft/react-native-windows

Creating a Native UI Component Crashes On ARM64

Open
#12,970 19 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug External Partner: 3P Scenario: ARM64 Scenario: C# Workstream: Module Support
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

When creating a native module with any UI component we receive this error immediately at build time on the ARM64 debug configuration. This error was reproduced while following the instructions for creating a default RNW app with a custom UI module.
System.Reflection.MissingMetadataException: 'Windows.Foundation.IReference1'`
image

RN Version: "react-native": "0.72.7",
RNW Version "react-native-windows": "0.72.24"
ReactNativeNativeModuleSample.csproj
Base App csproj

Steps To Reproduce
  1. Create a base C# RNW project
  2. Create a new C# native module and auto-link
  3. Add a UI component
  4. Run an ARM64 debug build.
Expected Results

Do not recieve the system.reflection error at runtime

CLI version

11.3.10

Environment
System:
  OS: Windows 11 10.0.26080
  CPU: "(12) x64 Snapdragon® X Elite - X1E78100 - Qualcomm® Oryon⢠CPU"
  Memory: 6.45 GB / 15.36 GB
Binaries:
  Node:
    version: 20.10.0
    path: C:\Program Files (x86)\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.2.3
    path: C:\Program Files (x86)\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.9.34723.18 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.7
    wanted: 0.72.7
  react-native-windows:
    installed: 0.72.24
    wanted: 0.72.24
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)

No response

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

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

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the ARM64 Debug build from the listed steps with React Native 0.72.7 and React Native Windows 0.72.24. Inspect the linked ReactNativeNativeModuleSample.csproj and base-app csproj while tracing the System.Reflection.MissingMetadataException for Windows.Foundation.IReference. Done means a native UI module builds and runs without this error on ARM64.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, react-native
Domain
build-system, desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.