microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.12k stars 1.13k forks source link

Can't start a fresh project with version 0.73.8 on non en-us Windows #12762

Open dante-cervantes-rocketlab opened 4 months ago

dante-cervantes-rocketlab commented 4 months ago

Problem Description

When trying to run a project i got an issue related to Newtonsoft trying to find version 13.0.0.0, however im not using NuGet to install anything this is a fresh project.

Steps To Reproduce

1 .- Run npx react-native init test 2 .- npx react-native-windows-init --overwrite 3 .- Run npx react-native run-windows 4 .- Got issue with Newtonsoft 13.0.0.0

Captura de pantalla 2024-02-25 225316

Expected Results

CLI version

0.73.4

Environment

System:
  OS: Windows 11 10.0.22000
  CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
  Memory: 46.93 GB / 63.91 GB
Binaries:
  Node:
    version: 20.11.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.21
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.2.4
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.9.34616.47 (Visual Studio Community 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.73.4
    wanted: 0.73.4
  react-native-windows:
    installed: 0.73.8
    wanted: 0.73.8
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

i Running x64 node on a x64 machine El sistema no puede encontrar la ruta especificada. i Verbose: ON Looking for VS installs with version range: [17.0,18.0) Looking for vswhere at: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe √ Found compatible MSBuild at C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin (17.9.34616.47) Versión de MSBuild 17.9.5+33de0b227 para .NET Framework Compilación iniciada a las 25/2/2024 22:56:46.

Proyecto "C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln" en el nodo 1 (Restore destinos). ValidateSolutionConfiguration: Compilando la configuración de soluciones "Debug|x64". _GetAllRestoreProjectPathItems: Determinando los proyectos que se van a restaurar... Restore: La validación de la cadena de certificados X.509 utilizará el almacén de confianza predeterminado seleccionado por .N ET para la firma de código. La validación de la cadena de certificados X.509 utilizará el almacén de confianza predeterminado seleccionado por .N ET para la marca de tiempo. Compilación del proyecto terminada "C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln" (Restore destino s).

Compilación correcta. 0 Advertencia(s) 0 Errores

Tiempo transcurrido 00:00:01.13 √ Restoring NuGet packages ⠋ Auto-linking... Parsing project... Found Windows app project, config: { folder: 'C:\Users\Dante Cervantes\Documents\projects\test', sourceDir: 'windows', solutionFile: 'test.sln', project: { projectFile: 'test\test.vcxproj', projectName: 'test', projectLang: 'cpp', projectGuid: '{895d2115-1b27-45d6-9322-1bf6c76fea1c}' }, experimentalFeatures: { UseHermes: 'true', UseWinUI3: 'false', UseExperimentalNuget: 'false', ReactExperimentalFeaturesSet: 'true' } } Parsing dependencies... Calculating AutolinkedNativeModules.g.cpp... Reading AutolinkedNativeModules.g.cpp... No changes to AutolinkedNativeModules.g.cpp. Calculating AutolinkedNativeModules.g.props... Reading AutolinkedNativeModules.g.props... No changes to AutolinkedNativeModules.g.props. Calculating AutolinkedNativeModules.g.targets... Reading AutolinkedNativeModules.g.targets... No changes to AutolinkedNativeModules.g.targets. Calculating test.sln changes... √ Auto-linking... Success: No auto-linking changes necessary. (14ms) √ Found Solution: C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln i Build configuration: Debug i Build platform: x64 Running MSBuild with args /clp:NoSummary;NoItemAndPropertyList;Verbosity=normal /nologo /p:Configuration=Debug /p:Platform=x64 /p:AppxBundle=Never /bl /flp1:errorsonly;logfile=C:\Users\DANTEC~1\AppData\Local\Temp\msbuild_46488_build.err /flp2:warningsonly;logfile=C:\Users\DANTEC~1\AppData\Local\Temp\msbuild_46488_build.wrn /maxCpuCount /restore /p:RestorePackagesConfig=true /p:RunAutolinkCheck=false Compilación iniciada a las 25/2/2024 22:56:48.

 1>Proyecto "C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln" en el nodo 1 (Restore destinos).
 1>ValidateSolutionConfiguration:
     Compilando la configuración de soluciones "Debug|x64".
   _GetAllRestoreProjectPathItems:
     Determinando los proyectos que se van a restaurar...
   Restore:
     La validación de la cadena de certificados X.509 utilizará el almacén de confianza predeterminado seleccionado
      por .NET para la firma de código.
     La validación de la cadena de certificados X.509 utilizará el almacén de confianza predeterminado seleccionado
      por .NET para la marca de tiempo.
 1>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targe
   ts(169,5): error : No se puede cargar el archivo o ensamblado 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutra
   l, PublicKeyToken=30ad4fe6b2a6aeed' ni una de sus dependencias. El sistema no puede encontrar el archivo especif
   icado. [C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln]
 1>Compilación del proyecto terminada "C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln" (Restore
   destinos) -- ERROR.

Mensajes aplazados

     Resumen detallado de la compilación
     ======================

     ============================== Jerarquía de la compilación (los identificadores representan configuraciones) =
     ====================================================
     Id.                  : Tiempo exclusivo   Tiempo total   Ruta (destinos)
     --------------------------------------------------------------------------------------------------------------
     ---------------------
     0                   : 0.409 s           0.795 s       C:\Users\Dante Cervantes\Documents\projects\test\windows
     \test.sln (Restore)
     | 1                 : 0.152 s           0.152 s       C:\Users\Dante Cervantes\Documents\projects\test\windows
     \test\test.vcxproj (_IsProjectRestoreSupported)
     | 6                 : 0.123 s           0.123 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Common\Common.vcxproj (_IsProjectRestoreSupported)
     | 5                 : 0.163 s           0.163 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj (_IsProjectRestoreSupported)
     | 4                 : 0.121 s           0.121 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\ReactCommon\ReactCommon.vcxproj (_IsProjectRestoreSupported)
     | 3                 : 0.122 s           0.122 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\fmt\fmt.vcxproj (_IsProjectRestoreSupported)
     | 2                 : 0.121 s           0.121 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Folly\Folly.vcxproj (_IsProjectRestoreSupported)
     | 8                 : 0.043 s           0.043 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Folly\Folly.vcxproj (_GenerateRestoreProjectPathWalk)
     | 9                 : 0.010 s           0.010 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\fmt\fmt.vcxproj (_GenerateRestoreProjectPathWalk)
     | 7                 : 0.006 s           0.050 s       C:\Users\Dante Cervantes\Documents\projects\test\windows
     \test\test.vcxproj (_GenerateRestoreProjectPathWalk)
     | . 11              : 0.000 s           0.000 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj (_GenerateRestoreProjectPathWal
     k)
     | 11                : 0.011 s           0.047 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj (_GenerateRestoreProjectPathWal
     k)
     | | 10              : 0.000 s           0.000 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\ReactCommon\ReactCommon.vcxproj (_GenerateRestoreProjectPathWalk)
     | | 8               : 0.000 s           0.000 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Folly\Folly.vcxproj (_GenerateRestoreProjectPathWalk)
     | . 12              : 0.000 s           0.000 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Common\Common.vcxproj (_GenerateRestoreProjectPathWalk)
     | 12                : 0.010 s           0.010 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Common\Common.vcxproj (_GenerateRestoreProjectPathWalk)
     | 10                : 0.011 s           0.045 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\ReactCommon\ReactCommon.vcxproj (_GenerateRestoreProjectPathWalk)
     | . 8               : 0.000 s           0.000 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Folly\Folly.vcxproj (_GenerateRestoreProjectPathWalk)
     | 19                : 0.091 s           0.091 s       C:\Users\Dante Cervantes\Documents\projects\test\windows
     \test\test.vcxproj (_GenerateRestoreGraphProjectEntry)
     | 18                : 0.011 s           0.011 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\fmt\fmt.vcxproj (_GenerateRestoreGraphProjectEntry)
     | 17                : 0.018 s           0.018 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\ReactCommon\ReactCommon.vcxproj (_GenerateRestoreGraphProjectEntry)
     | 16                : 0.016 s           0.016 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Folly\Folly.vcxproj (_GenerateRestoreGraphProjectEntry)
     | 15                : 0.044 s           0.044 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Common\Common.vcxproj (_GenerateRestoreGraphProjectEntry)
     | 14                : 0.016 s           0.016 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj (_GenerateRestoreGraphProjectEn
     try)
     | 21                : 0.019 s           0.019 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Common\Common.vcxproj (_GenerateProjectRestoreGraph)
     | 25                : 0.040 s           0.040 s       C:\Users\Dante Cervantes\Documents\projects\test\windows
     \test\test.vcxproj (_GenerateProjectRestoreGraph)
     | 24                : 0.011 s           0.011 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\fmt\fmt.vcxproj (_GenerateProjectRestoreGraph)
     | 23                : 0.019 s           0.019 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\ReactCommon\ReactCommon.vcxproj (_GenerateProjectRestoreGraph)
     | 22                : 0.015 s           0.015 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Folly\Folly.vcxproj (_GenerateProjectRestoreGraph)
     . 20                : 0.018 s           0.018 s       C:\Users\Dante Cervantes\Documents\projects\test\node_mo
     dules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj (_GenerateProjectRestoreGraph)

     ============================== Utilización de nodos (los identificadores representan configuraciones) ========
     =============================================
     Marca de tiempo:            Duración de 1       6       4       5       2       3          Acumulado
     --------------------------------------------------------------------------------------------------------------
     ---------------------
     638445202088946099:   0       x       x       x       x       x        0.171 s     0.171 s ...
     638445202090656083:   1       x       x       x       x       x        0.041 s     0.212 s
     638445202091065781:   |       2       3       4       5       6        0.111 s     0.323 s ..
     638445202092175786:   x       |       |       |       |       |        0.011 s     0.334 s
     638445202092285776:   x       x       |       x       |       |        0.001 s     0.335 s
     638445202092295773:   x       x       x       x       |       |        0.001 s     0.336 s
     638445202092305776:   x       x       x       x       |       x        0.040 s     0.376 s
     638445202092705773:   0       x       x       x       x       x        0.011 s     0.387 s
     638445202092815780:   7       8       9       10      11      12       0.004 s     0.391 s
     638445202092855779:   x       |       |       |       |       |        0.005 s     0.396 s
     638445202092905771:   x       |       |       x       x       |        0.001 s     0.397 s
     638445202092915772:   x       |       x       x       x       x        0.033 s     0.430 s
     638445202093245782:   x       x       x       10      x       x        0.002 s     0.432 s
     638445202093265784:   x       x       x       x       11      x        0.002 s     0.434 s
     638445202093285774:   7       x       x       x       x       x        0.003 s     0.437 s
     638445202093315777:   0       x       x       x       x       x        0.003 s     0.440 s
     638445202093346084:   19      16      18      17      14      15       0.011 s     0.451 s
     638445202093455775:   |       |       x       |       |       |        0.005 s     0.456 s
     638445202093505778:   |       x       x       |       x       |        0.002 s     0.458 s
     638445202093525783:   |       x       x       x       x       |        0.026 s     0.484 s
     638445202093785779:   |       x       x       x       x       x        0.047 s     0.531 s
     638445202094256109:   25      22      24      23      20      21       0.012 s     0.543 s
     638445202094375771:   |       |       x       |       |       |        0.004 s     0.547 s
     638445202094415772:   |       x       x       |       |       |        0.003 s     0.550 s
     638445202094445797:   |       x       x       |       x       |        0.001 s     0.551 s
     638445202094456076:   |       x       x       x       x       x        0.021 s     0.572 s
     638445202094665782:   0       x       x       x       x       x        0.229 s     0.801 s ....
     --------------------------------------------------------------------------------------------------------------
     ---------------------
     Utilización:          Utilización media de 88.0    33.4    26.5    29.0    35.6    33.6    : 41.0

× Building Solution × Build failed with message 1>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(169,5): error : No se puede cargar el archivo o ensamblado 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado. [C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln]. Check your build configuration. i Gathering MSBuild data for telemetry. i Unable to find msbuildproperties.g.json Command failed with error MSBuildError: 1>C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(169,5): error : No se puede cargar el archivo o ensamblado 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado. [C:\Users\Dante Cervantes\Documents\projects\test\windows\test.sln] Your telemetry sessionId was 7ee5ceaa6d748da08dbc5a1f995b4242

chrisglein commented 4 months ago

I just tried creating a fresh 0.73.8 project with these steps:

npx react-native@latest init blankApp --version "latest"
cd blankApp
npx react-native-windows-init --overwrite
npx react-native run-windows

And it built and ran fine.

Here's the rn info:

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.23660
  CPU: "(24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores     "
  Memory: 48.75 GB / 63.86 GB
Binaries:
  Node:
    version: 18.16.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.5.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.9.34616.47 (Visual Studio Community 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.73.5
    wanted: 0.73.5
  react-native-windows:
    installed: 0.73.8
    wanted: 0.73.8
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

So... something must be different between your configuration and mine. Nothing obvious leaps out to me. Did you make any more edits to the project after creation? What else have you tried so far?

dante-cervantes-rocketlab commented 4 months ago

@chrisglein Thanks for the response.

I was able to make it run, i installed the multiplatform compat from Visual Studio and that did the trick.

Thanks.

chrisglein commented 4 months ago

So glad to hear you're unblocked! You ran the dependency script and it ran clean (all green checks)? If so then this may be a problem with the dependency script missing a required component. Perhaps something not required for en-us locales but required beyond that.

Next action for us would be to double check our dependency script on a clean machine with a non en-us language.