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

NativeModuleSample cppwinrt fails to build: Cannot open include file: 'winrt/impl/Windows.Devices.Bluetooth.GenericAttributeProfile.1.h'

Open chrisglein opened this issue 1 year ago • 7 comments

Sample

NativeModuleSample

Problem Description

NativeModuleSample cppwinrt fails to build:

Cannot open include file: 'winrt/impl/Windows.Devices.Bluetooth.GenericAttributeProfile.1.h'

Time Elapsed 00:00:00.55
√ Restoring NuGet packages
 i Autolink step is skipped
 √ Found Solution: C:\Users\redacted\Source\react-native-windows-samples\samples\NativeModuleSample\cppwinrt\windows\NativeModuleSample.sln
 i Build configuration: Debug
 i Build platform: x64
 × Building Solution: C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\XamlCompiler\Microsoft.Windows.UI.X...
 × Build failed with message 7:7>C:\Users\redacted\Source\react-native-windows-samples\samples\NativeModuleSample\cppwinrt\node_modules\react-native-windows\Microsoft.ReactNative\build\x64\Debug\Microsoft.ReactNative\Generated Files\winrt\impl\Windows.ApplicationModel.Background.2.h(8,10): fatal  error C1083: Cannot open include file: 'winrt/impl/Windows.Devices.Bluetooth.GenericAttributeProfile.1.h': No such file or directory (compiling source file C:\Users\redacted\Source\react-native-windows-samples\samples\NativeModuleSample\cppwinrt\node_modules\react-native-windows\Shared\Executors\WebSocketJSExecutor.cpp) [C:\Users\redacted\Source\react-native-windows-samples\samples\NativeModuleSample\cppwinrt\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]. Check your build configuration.
Command failed. Re-run the command with --logging for more information.

Steps To Reproduce

(See readme)

  1. Clone repo
  2. cd samples\NativeModuleSample\cppwinrt
  3. yarn
  4. npx react-native run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.vsproj"

Expected Results

follow instructions in readme, get build

CLI version

10.0.0

Environment

info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.23447
    CPU: (24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores
    Memory: 40.40 GB / 63.86 GB
  Binaries:
    Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 9.4.1 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
      AllowAllTrustedApps: 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.5.33530.505 (Visual Studio Community 2022), 16.11.33529.622 (Visual Studio Community 2019)
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.0 => 0.71.0
    react-native-windows: 0.71.0 => 0.71.0
  npmGlobalPackages:
    *react-native*: Not Found

Target Platform Version

None

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

chrisglein avatar May 01 '23 18:05 chrisglein