Skip to content
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

Build failed with message Error: MSBuild tools not found. Check your build configuration. #2420

Closed
birobirobiro opened this issue May 7, 2019 · 35 comments
Labels

Comments

@birobirobiro
Copy link

image

@harinikmsft
Copy link
Contributor

Can you provide details of your setup? Which VS version, Windows SDK, setup steps are you running?

@reddvid
Copy link

reddvid commented May 7, 2019

I also got this issue, I'm on Win 10 Insider Preview 18890, VS 2019 (as per requirements VS2017 or greater).

Followed Getting-started-current and failed on that step (run on VS/run-windows).

Installed C++ workload and MSVC/ATL 141 build tools. Still fails.

@MungeParty
Copy link

I had the same issue until I installed VS 2017 specifically.

@birobirobiro
Copy link
Author

I was able to solve using v-next

https://youtu.be/kvfuGsOA_T8

@reutopiaer
Copy link

I can build success with sln but still get error "Build failed with message Error: MSBuild tools not found. Check your build configuration."
rnw

@mateuszgazdziak
Copy link

Anyone knows how to run it on vs 2019?

@stratospheres
Copy link

stratospheres commented May 15, 2019

Anyone knows how to run it on vs 2019?

Pretty sure it's going to be related to a lack of support here:

<yourapp>\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js

I can get it to finish building and start by (and please don't do this and expect anything but a hack, but...) doing the following in the checkMSBuildVersion() function, just before the final return:

if (version === "16.0") {
   toolsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
}

In order to get that to be called, I updated the array of possible version values at line 12 of the file to:

MSBUILD_VERSIONS = ['16.0', '15.0', '14.0', '12.0', '4.0'];

Finally, you need to hack the buildProject() function as well to handle VS2019 version numbers... look for the comment around line 40 referring to VS2017 and do something similar for V16/VS2019.

if (this.version === '16.0') {
  args.push('/p:PlatformToolset=v142');
  args.push('/p:VisualStudioVersion=16.0');
}

Also
To be super clear - this is for a machine with VS2019 only (no VS2017 installation) and the vNext template. Also, YMMV, and this is a hack - just to get up and running to play. Don't leave your code like this in the long haul, even if you get it working.

UPDATE: there's a tracking issue for VS2019 support here: #2320 .

@reutopiaer
Copy link

@stratospheres Tank you very much! It's works!

@nguyen-tam
Copy link

nguyen-tam commented May 16, 2019

The same here, MS should fix this ASAP

@saraswathirbt
Copy link

Build failed with message Error: MSBuild tools not found. Check your build configuration. facing with the same issue can any one help to solve this, Thanks in advance

@ShrinathGupta
Copy link
Contributor

I tried with both the VS 2017 as well as 2019 and even tried doing above hack. But not succeed. Getting same error.
Does anyone know about any other work around? Thanks.

@ShrinathGupta
Copy link
Contributor

I can build success with sln but still get error "Build failed with message Error: MSBuild tools not found. Check your build configuration."
rnw

I tried with both the VS 2017 as well as 2019 and even tried doing above hack. But not succeed. Getting same error.
Does anyone know about any other work around? Thanks.

@ralexand56
Copy link

So frustrating that this doesn't work with MS' own latest dev tools and doesn't work with the latest version of react native. I wish MS would devote more resources to this project.

@harinikmsft
Copy link
Contributor

Apologies on this. As @stratospheres pointed out, we are working on making the CLI for vnext work with VS 2019. Issue #2320 is tracking this (we just submitted a first PR #2539) .

You can follow the Advanced install method specified here - Advanced install for working on vNext with VS 2019 until we fix the buildpath issues with the CLI.

@ShrinathGupta
Copy link
Contributor

@harinikmsft Thanks for addressing issue and giving workaround.

@marlenecota
Copy link
Contributor

We merged a couple of fixes yesterday (#2539 and #2396). Please try it out and let us know if you are still seeing issues.

@harinikmsft
Copy link
Contributor

Closing as verified locally. Please reopen if you are still seeing issues post the fixes from PRs #2539 and #2396

@hmheng
Copy link

hmheng commented Jun 5, 2019

@harinikmsft, still facing the same issue with rnwindows 0.57 versions.
I have VS2017 and VS2019 installed.

@harinikmsft
Copy link
Contributor

Sorry to hear that @hmheng. @marlenecota - can you take a look again?

@harinikmsft harinikmsft reopened this Jun 5, 2019
@ShrinathGupta
Copy link
Contributor

@harinikmsft Even same behavior for me. :( It's not working.

@MungeParty
Copy link

Same here on version 0.57.1, haven't tried vnext since due to lack of transform animation.

@marlenecota
Copy link
Contributor

Ah, my fix was only for vnext. @ShrinathGupta were you also using current?

@hmheng
Copy link

hmheng commented Jun 7, 2019

If we upgrade to vnext, it works fine on Windows, but it will break android compilation. I haven't try ios yet.

@ShrinathGupta
Copy link
Contributor

Ah, my fix was only for vnext. @ShrinathGupta were you also using current?

@marlenecota Yes i was using vnext and i was building uwp app.

rozele pushed a commit that referenced this issue Jun 7, 2019
@marlenecota
Copy link
Contributor

@hmheng, @ShrinathGupta - 0.57.2 and 0.58.0-rc.2 have been patched. Please give that a go.

@hmheng
Copy link

hmheng commented Jun 8, 2019

@marlenecota thank you..
My reactnative version is RN 0.57..

PS D:\PS\Repos\RNWindows> react-native windows --template current
Reading application name from package.json...
Reading react-native version from node_modules...
Checking for react-native-windows version matching 0.57....
Could not find react-native-windows@0.57.
-current.*.

However, if I use react-native windows --windowsVersion ~0.57.. it works with RNW0.57.2

For RN 0.58..
it looks good with RNW 0.58.-rc.2
thank you

@ShrinathGupta
Copy link
Contributor

@marlenecota It has been long time since i worked on it. Good news today i checked and it worked. Awesome thanks @marlenecota 👏 💯

@ShrinathGupta
Copy link
Contributor

If anybody wants to give a try to react native windows vnext.
They can try https://github.com/ShrinathGupta/React-native-windows-demo
It's awesome. I worked on previous version of it, vnext is far better then that although development is still ongoing.

@chrisglein
Copy link
Member

Sounds like this is resolved.

@Mohammad-Adam
Copy link

Anyone knows how to run it on vs 2019?

Pretty sure it's going to be related to a lack of support here:

<yourapp>\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js

I can get it to finish building and start by (and please don't do this and expect anything but a hack, but...) doing the following in the checkMSBuildVersion() function, just before the final return:

if (version === "16.0") {
   toolsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
}

In order to get that to be called, I updated the array of possible version values at line 12 of the file to:

MSBUILD_VERSIONS = ['16.0', '15.0', '14.0', '12.0', '4.0'];

Finally, you need to hack the buildProject() function as well to handle VS2019 version numbers... look for the comment around line 40 referring to VS2017 and do something similar for V16/VS2019.

if (this.version === '16.0') {
  args.push('/p:PlatformToolset=v142');
  args.push('/p:VisualStudioVersion=16.0');
}

Also
To be super clear - this is for a machine with VS2019 only (no VS2017 installation) and the vNext template. Also, YMMV, and this is a hack - just to get up and running to play. Don't leave your code like this in the long haul, even if you get it working.

UPDATE: there's a tracking issue for VS2019 support here: #2320 .

just provided "msbuild.exe" path to "toolsPath" var ,

in "\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js"

and now it is working ,

thank you.

@matt-d-webb
Copy link

Anyone knows how to run it on vs 2019?

Pretty sure it's going to be related to a lack of support here:

<yourapp>\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js

I can get it to finish building and start by (and please don't do this and expect anything but a hack, but...) doing the following in the checkMSBuildVersion() function, just before the final return:

if (version === "16.0") {
   toolsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
}

In order to get that to be called, I updated the array of possible version values at line 12 of the file to:

MSBUILD_VERSIONS = ['16.0', '15.0', '14.0', '12.0', '4.0'];

Finally, you need to hack the buildProject() function as well to handle VS2019 version numbers... look for the comment around line 40 referring to VS2017 and do something similar for V16/VS2019.

if (this.version === '16.0') {
  args.push('/p:PlatformToolset=v142');
  args.push('/p:VisualStudioVersion=16.0');
}

Also
To be super clear - this is for a machine with VS2019 only (no VS2017 installation) and the vNext template. Also, YMMV, and this is a hack - just to get up and running to play. Don't leave your code like this in the long haul, even if you get it working.
UPDATE: there's a tracking issue for VS2019 support here: #2320 .

just provided "msbuild.exe" path to "toolsPath" var ,

in "\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js"

and now it is working ,

thank you.

Can you explain this in more detail, please?

@ghost ghost added the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Sep 16, 2020
@chrisglein chrisglein removed the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Sep 21, 2020
@ghost ghost added the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Jul 7, 2021
@gaurav8809
Copy link

Anyone knows how to run it on vs 2019?

Pretty sure it's going to be related to a lack of support here:

<yourapp>\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js

I can get it to finish building and start by (and please don't do this and expect anything but a hack, but...) doing the following in the checkMSBuildVersion() function, just before the final return:

if (version === "16.0") {
   toolsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
}

In order to get that to be called, I updated the array of possible version values at line 12 of the file to:

MSBUILD_VERSIONS = ['16.0', '15.0', '14.0', '12.0', '4.0'];

Finally, you need to hack the buildProject() function as well to handle VS2019 version numbers... look for the comment around line 40 referring to VS2017 and do something similar for V16/VS2019.

if (this.version === '16.0') {
  args.push('/p:PlatformToolset=v142');
  args.push('/p:VisualStudioVersion=16.0');
}

Also
To be super clear - this is for a machine with VS2019 only (no VS2017 installation) and the vNext template. Also, YMMV, and this is a hack - just to get up and running to play. Don't leave your code like this in the long haul, even if you get it working.

UPDATE: there's a tracking issue for VS2019 support here: #2320 .

I can not find any path like this
"\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js"
I found file with this path
"\node_modules@react-native-windows\cli\lib-commonjs\runWindows\utils\msbuildtools.js"
But there is no such code mentioned
Please provide support

@chrisglein
Copy link
Member

Anyone knows how to run it on vs 2019?

Pretty sure it's going to be related to a lack of support here:

<yourapp>\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js

I can get it to finish building and start by (and please don't do this and expect anything but a hack, but...) doing the following in the checkMSBuildVersion() function, just before the final return:

if (version === "16.0") {
   toolsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
}

In order to get that to be called, I updated the array of possible version values at line 12 of the file to:

MSBUILD_VERSIONS = ['16.0', '15.0', '14.0', '12.0', '4.0'];

Finally, you need to hack the buildProject() function as well to handle VS2019 version numbers... look for the comment around line 40 referring to VS2017 and do something similar for V16/VS2019.

if (this.version === '16.0') {
  args.push('/p:PlatformToolset=v142');
  args.push('/p:VisualStudioVersion=16.0');
}

Also
To be super clear - this is for a machine with VS2019 only (no VS2017 installation) and the vNext template. Also, YMMV, and this is a hack - just to get up and running to play. Don't leave your code like this in the long haul, even if you get it working.
UPDATE: there's a tracking issue for VS2019 support here: #2320 .

I can not find any path like this
"\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js"
I found file with this path
"\node_modules@react-native-windows\cli\lib-commonjs\runWindows\utils\msbuildtools.js"
But there is no such code mentioned
Please provide support

@gaurav8809 This issue is almost a year old. Can you open a fresh issue that contains your environment info?

@chrisglein chrisglein removed the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Jul 12, 2021
@gaurav8809
Copy link

I can provide you my environment info here

Anyone knows how to run it on vs 2019?

Pretty sure it's going to be related to a lack of support here:

<yourapp>\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js

I can get it to finish building and start by (and please don't do this and expect anything but a hack, but...) doing the following in the checkMSBuildVersion() function, just before the final return:

if (version === "16.0") {
   toolsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
}

In order to get that to be called, I updated the array of possible version values at line 12 of the file to:

MSBUILD_VERSIONS = ['16.0', '15.0', '14.0', '12.0', '4.0'];

Finally, you need to hack the buildProject() function as well to handle VS2019 version numbers... look for the comment around line 40 referring to VS2017 and do something similar for V16/VS2019.

if (this.version === '16.0') {
  args.push('/p:PlatformToolset=v142');
  args.push('/p:VisualStudioVersion=16.0');
}

Also
To be super clear - this is for a machine with VS2019 only (no VS2017 installation) and the vNext template. Also, YMMV, and this is a hack - just to get up and running to play. Don't leave your code like this in the long haul, even if you get it working.
UPDATE: there's a tracking issue for VS2019 support here: #2320 .

I can not find any path like this
"\node_modules\react-native-windows\local-cli\runWindows\utils\msbuildtools.js"
I found file with this path
"\node_modules@react-native-windows\cli\lib-commonjs\runWindows\utils\msbuildtools.js"
But there is no such code mentioned
Please provide support

@gaurav8809 This issue is almost a year old. Can you open a fresh issue that contains your environment info?

@ghost ghost added the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Jul 13, 2021
@chrisglein
Copy link
Member

I can provide you my environment info here

@gaurav8809 This issue is almost a year old. Can you open a fresh issue that contains your environment info?

Please open a new issue and follow the instructions in the template. That's the best way to help us to provide support.

@chrisglein chrisglein removed the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Jul 13, 2021
@microsoft microsoft locked as resolved and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests