React-native-windows: Errors running "react-native run-windows"

Created on 22 Jan 2018  路  8Comments  路  Source: microsoft/react-native-windows

Environment

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native: 0.52.1

  2. npm ls rnpm-plugin-windows:
    [email protected] C:\Users\eljam\Downloads\myapp
    `-- [email protected]

  3. npm ls react-native-windows:
    [email protected] C:\Users\eljam\Downloads\myapp
    `-- [email protected]

  4. node -v:
    v8.9.3

  5. npm -v:
    5.5.1

  6. yarn --version:
    I don't

Then, specify:

  • Target Platform:
    UWP

  • Target Platform Version(s):

  • Target Device(s):

  • Development Operating System:
    Windows 10

  • Visual Studio Version:
    2017

Steps to Reproduce

Run the following commands:
npm install -g react-native-cli
react-native init myapp
cd myapp
npm i --save-dev rnpm-plugin-windows
react-native windows
react-native run-windows

On running this last command I get errors. Here is the head portion of those errors:
C:\Users\eljam\Downloads\myapp>react-native run-windows
Scanning folders for symlinks in C:\Users\eljam\Downloads\myappnode_modules (37ms)
Restoring NuGet packages
Building C:/Users/eljam/Downloads/myapp/windows/myapp.sln
Found MSBuild v15.0 at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Building Solution: C:/Users/eljam/Downloads/myapp/windows/myapp.sln
Build configuration: Debug
Build platform: x86
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Properties\AssemblyInfo.cs(8,12): error CS0246: The type or namespace name 'AssemblyTitleAttribute' could not be found
(are you missing a using directive or an assembly reference?) [C:\Users\eljam\Downloads\myappnode_modules\react-native
-windows\ReactWindows\ReactNativeWebViewBridge\ReactNativeWebViewBridge.csproj]
Properties\AssemblyInfo.cs(8,12): error CS0246: The type or namespace name 'AssemblyTitle' could not be found (are you
missing a using directive or an assembly reference?) [C:\Users\eljam\Downloads\myappnode_modules\react-native-windows\
ReactWindows\ReactNativeWebViewBridge\ReactNativeWebViewBridge.csproj]
Properties\AssemblyInfo.cs(9,12): error CS0246: The type or namespace name 'AssemblyDescriptionAttribute' could not be
found (are you missing a using directive or an assembly reference?) [C:\Users\eljam\Downloads\myappnode_modules\react-
native-windows\ReactWindows\ReactNativeWebViewBridge\ReactNativeWebViewBridge.csproj]

Most helpful comment

targeting

Edited the targeting on the web bridge project and now builds.

All 8 comments

targeting

Edited the targeting on the web bridge project and now builds.

same error here

I'm seeing the exact same issue as well, and can't resolve it. OP steps to reproduce still exhibit the issue.

UPDATE: @db-rdz comment at https://github.com/Microsoft/react-native-windows/issues/1593 solved the problem.

I am getting same error. The above fix does not work!

Can you run react-native run-windows --verbose and drop the output somewhere? It looks like NuGet restore is failing, but hard to tell from the pasted logs.

$ react-native run-windows --verbose
Restoring NuGet packages
MSBuild auto-detection: using msbuild version '15.9.21.664' from 'D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin'.
Restoring packages for D:\Android\Project\CleanProject\windows\CleanProject\CleanProject.csproj...
Restoring packages for D:\Android\Project\CleanProject\node_modules\react-native-windows\ReactWindows\ReactNative\ReactNative.csproj...
Restoring packages for D:\Android\Project\CleanProject\node_modules\react-native-windows\ReactWindows\ReactNativeWebViewBridge\ReactNativeWebViewBridge.csproj...
Committing restore...
Lock file has not changed. Skipping lock file write. Path: D:\Android\Project\CleanProject\node_modules\react-native-windows\ReactWindows\ReactNativeWebViewBridge\obj\project.assets.json
Restore completed in 3,51 sec for D:\Android\Project\CleanProject\node_modules\react-native-windows\ReactWindows\ReactNativeWebViewBridge\ReactNativeWebViewBridge.csproj.
Committing restore...
Committing restore...
Lock file has not changed. Skipping lock file write. Path: D:\Android\Project\CleanProject\windows\CleanProject\obj\project.assets.json
Restore completed in 3,94 sec for D:\Android\Project\CleanProject\windows\CleanProject\CleanProject.csproj.
Lock file has not changed. Skipping lock file write. Path: D:\Android\Project\CleanProject\node_modules\react-native-windows\ReactWindows\ReactNative\obj\project.assets.json
Restore completed in 3,94 sec for D:\Android\Project\CleanProject\node_modules\react-native-windows\ReactWindows\ReactNative\ReactNative.csproj.

NuGet Config files used:
    C:\Users\Freddy\AppData\Roaming\NuGet\NuGet.Config
    C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config

Feeds used:
    https://api.nuget.org/v3/index.json
    C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Build failed with message Error: Must have a minimum Windows SDK version 10.0.10586.0 installed. Check your build configuration.

Doesn't work for me either, thats what I am getting for $ react-native run-windows --verbose

@eljamaki01 , @db-rdz solution worked for me https://github.com/Microsoft/react-native-windows/issues/1593

Closing. This issue is quite out of date. We've recently updated the minimum target version for React Native Windows to 10.0.14393.

Was this page helpful?
0 / 5 - 0 ratings