-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a Native UI Component Crashes On ARM64 #12970
Comments
While I'm not sure if there were any changes in 0.73 (or the soon to be released 0.74, probably next week), have you tried updating to a newer version? 0.72 is just outside of the support window: https://microsoft.github.io/react-native-windows/support |
The error is still reproducible on latest Here is the next message when I hit continue Here is an updated example repo And new react-native info |
Thanks for taking the upgrade to check that out! Sorry it wasn't helpful. We do have some test coverage of ARM64, but we have less coverage of it as a development environment. Our first guess is that we're missing something in our dependency script specifically for ARM64 dev. What would help:
|
No problem. This error doesn't occur in release configurations so it makes sense if something was missed for a development environment. Here is a repo using RNW latest which contains the problem. Here is a straight UWP C# Xaml Project calling virtually the same APIs without the RNW UI View Manager which does not error out. They are both targeting 10.0.19041.0 The callstack from when I click "view callstack" appears empty |
I went ahead and upgraded the windows version to latest to test and the issue still persists. |
Turns out this also occurs in release configurations with more complicated UI components also. With this we are completely blocked on a native ARM integration. |
Are you able to build ARM64 on an x64 machine and then deploy to the ARM64 device? |
Yes but it than just crashes immediately on startup instead. |
Can you open your project files (csproj) and where it has the configuration section for ARM64 Debug, i.e. |
This problem is in both configurations for us whether it is running dotnet native toolchain or not. Also UseDotNetNativeToolChain has no effect on ARM64 so its running with this set to true by default anyways. At least that was my interpretation since it always reset the option on a build when I add this setting through visual studio and I found this issue. |
It looks like maybe you're hitting an issue with 19041 +UWP + .NET Native not liking library projects that define XAML controls. Can you try the workaround suggested here: microsoft/microsoft-ui-xaml#2545 (comment) : Please try setting EnableTypeInfoReflection to false in each project that uses XAML: <PropertyGroup>
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
</PropertyGroup> |
We have also tried this as well and it just causes it to error out with a different message. |
We have also updated or windows sdk version to latest and can reproduce this issue. |
The Issue also is not reproduced in a default UWP application. Specifically, we only see this when
|
I have an example here where i have a github repo for a UWP app as well as a latest version react native for windows application running ARM64 builds. |
It probably doesn't repro in your UWP default application because it's not using WinUI 2 (aka Microsoft.UI.Xaml). RNW and all RNW libs depend on WinUI 2, and it appears there's some issue with .net native on arm64 not liking library projects that rely on WinUI 2. I know it's not ideal (I assume you're creating a ui component library because you want multiple apps to consume it) but can you try moving the library source (your custom component and viewmanagers) directly into the app project? |
We can try, its not ideal and may not work with our project structure at the end of the day but its worth a shot. |
We use these UI components as node packages which are consumed by other UI only react native packages. With this in mind its going to be extremely difficult to "un-modularize" everything to fix this. |
This makes sense, the error is we originally found when using components from legacy WinUI components (Windows.UI.Xaml). But many of our components do not have a WinUI2 equivalent available. |
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.IReference
1'`RN Version: "react-native": "0.72.7",
RNW Version "react-native-windows": "0.72.24"
ReactNativeNativeModuleSample.csproj
Base App csproj
Steps To Reproduce
Expected Results
Do not recieve the system.reflection error at runtime
CLI version
11.3.10
Environment
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
The text was updated successfully, but these errors were encountered: