Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 9, 2025

  • Detect processor architecture in rnw-dependencies.ps1 (using same logic as Add-AppDevPackage.ps1)
  • Conditionally set VC Tools component based on architecture (ARM64 vs x86.x64)
  • Test the changes to ensure they work correctly
  • Verified changes work for both ARM64 and AMD64 scenarios
  • Add beachball change file for versioning
Original prompt

This section details on the original issue you should resolve

<issue_title>Unable to build gallery on a fresh ARM64 machine</issue_title>
<issue_description>I've Visual Studio 2022, Git, Node and Yarn installed. Ran ./node_modules/react-native-windows/Scripts/rnw-dependencies.ps1 from an elevated Powershell.

yarn windows fails to build due to node_modules\@react-native-clipboard\clipboard\windows\Clipboard\Clipboard.vcxproj failing to build.

D:\work\react-native-gallery\NewArch>yarn windows --release
 MSBuild version 17.14.23+b0019275e for .NET Framework
Build started 2025-10-08 15:07:02.

Project "D:\work\react-native-gallery\NewArch\windows\NewArch.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Release|ARM64".
D:\work\react-native-gallery\NewArch\node_modules\react-native-windows\PropertySheets\External\Microsoft.ReactNative.Common.props(46,3): warning MSB4011
: "D:\work\react-native-gallery\NewArch\node_modules\react-native-windows\PropertySheets\Generated\PackageVersion.g.props" cannot be imported again. It
was already imported at "D:\work\react-native-gallery\NewArch\node_modules\@react-native-clipboard\clipboard\windows\Clipboard\Clipboard.vcxproj (41,3)"
. This is most likely a build authoring error. This subsequent import will be ignored.
_GetAllRestoreProjectPathItems:
  Determining projects to restore...
Restore:
  X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
  X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
    CACHE https://api.nuget.org/v3/vulnerabilities/index.json
    CACHE https://api.nuget.org/v3-vulnerabilities/2025.10.08.05.30.15/vulnerability.base.json
    CACHE https://api.nuget.org/v3-vulnerabilities/2025.10.08.05.30.15/2025.10.08.05.30.15/vulnerability.update.json
Done Building Project "D:\work\react-native-gallery\NewArch\windows\NewArch.sln" (Restore target(s)).


Build succeeded.

  D:\work\react-native-gallery\NewArch\node_modules\react-native-windows\PropertySheets\External\Microsoft.ReactNative.Common.props(46,3): warning MSB40
11: "D:\work\react-native-gallery\NewArch\node_modules\react-native-windows\PropertySheets\Generated\PackageVersion.g.props" cannot be imported again. I
t was already imported at "D:\work\react-native-gallery\NewArch\node_modules\@react-native-clipboard\clipboard\windows\Clipboard\Clipboard.vcxproj (41,3
)". This is most likely a build authoring error. This subsequent import will be ignored.

    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.96
√ Restoring NuGet packages
 √ Auto-linking...
Success: No auto-linking changes necessary. (41ms)
 √ Found Solution: D:\work\react-native-gallery\NewArch\windows\NewArch.sln
 i Build configuration: Release
 i Build platform: ARM64
 × Building Solution: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsof...
 × Build failed with message 3:10>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.22621.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [D:\work\react-native-gallery\NewArch\node_modules\@react-native-clipboard\clipboard\windows\Clipboard\Clipboard.vcxproj]. Check your build configuration.
Command failed. Re-run the command with --logging for more information.

Of course, trying npx react-native run-windows --logging shows the same error since this is a C++ project build issue.</issue_description>

<agent_instructions>Switch to Microsoft.VisualStudio.Component.VC.Tools.ARM64 instead of Microsoft.VisualStudio.Component.VC.Tools.x86.x64 if the machine architecture is ARM64 in the file //vnext/Scripts/rnw-dependencies.ps1.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@sundaramramaswamy Digging deeper, `node_modules/react-native-windows/Scripts/rnw-dependencies.ps1` doesn't install the expected Windows SDK 10.0.22621.0 on this ARM64 machine. Machine details
CPU: Snapdragon(R) X 12-core X1E80100 (12) @ 3.40 GHz
OS: Windows 11 Enterprise aarch64
Host: Microsoft Surface Laptop, 7th Edition
Kernel: WIN32_NT 10.0.26100.6584 (24H2)

This SDK is needed by clipboard.vcxproj via node_modules/react-native-windows/PropertySheets/External/Microsoft.ReactNative.WindowsSdk.Default.props.</comment_new>
<comment_new>@sundaramramaswamy
rnw-dependencies.ps1 assumes machine architecture (x86/64) and hence tries to install Microsoft.VisualStudio.Component.VC.Tools.x86.x64 instead of Microsoft.VisualStudio.Component.VC.Tools.ARM64.</comment_new>

Fixes microsoft/react-native-gallery#724

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Microsoft Reviewers: Open in CodeFlow

Copilot AI changed the title [WIP] Fix gallery build issue on fresh ARM64 machine Fix ARM64 support in rnw-dependencies.ps1 for Visual Studio component installation Oct 9, 2025
Copilot finished work on behalf of sundaramramaswamy October 9, 2025 10:36
Copy link
Contributor

@sundaramramaswamy sundaramramaswamy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sundaramramaswamy
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@vineethkuttan
Copy link
Contributor

@copilot run command yarn change or npm change at the root of the repo, and provide the requested details.

Copy link
Contributor Author

Copilot AI commented Oct 10, 2025

@copilot run command yarn change or npm change at the root of the repo, and provide the requested details.

Added beachball change file in commit e009fc0. The change file specifies a prerelease type for the react-native-windows package with details about the ARM64 fix.

Copilot finished work on behalf of vineethkuttan October 10, 2025 14:10
@vineethkuttan
Copy link
Contributor

/azp run PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vineethkuttan
Copy link
Contributor

@sundaramramaswamy did you test this script in a new ARM machine? To confirm whether it is working fine?

Copy link
Contributor

@HariniMalothu17 HariniMalothu17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sundaramramaswamy sundaramramaswamy merged commit 2b24344 into main Oct 12, 2025
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to build gallery on a fresh ARM64 machine

4 participants