X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" [duplicate] - c++

My Flutter Doctor is saying:
Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all
of its default components.
How can I fix this problem?

It's basically saying that if you want to develop your Flutter application for Windows you will need to install Visual Studio 2022 and while installing Visual Studio 2022 you will need to download this: Desktop development with C++
Also, you have to install the third link in this: Visual-studio
You could also get desktop development with the C++ tool after installing Visual Studio and then navigating to tool → Get tools and features → Desktop development with C++.

The error means install Visual Studio, and this is different from Visual Studio Code. It's an IDE from Microsoft.
For those who may be using a weak computer and can't afford to install the full Visual Studio, you only need to install a few components from Visual Studio to get Flutter to run on your computer without errors. These components are:
MSVC v142 - Visual Studio 2022 C++ x64/86 build tools.
Windows 10 SDK (for Windows 10 users)
C++ CMake tools for Windows.
In total, they should occupy around 8 GB or so.

As it states, you need to download Visual Studio (which is different from Visual Studio Code).
When installing it, remember to select the required package Desktop development with C++:
This will not prevent you from developing Mobile apps, but it's a requirement only for Windows Development.

Is unnecessary to install the "Desktop development with C++" if you don't want to develop desktop applications for Windows using Flutter.
If you only want to develop mobile apps using Flutter, you can run
flutter config --no-enable-windows-desktop
to disable the desktop support for your Flutter projects. After that, when you run the flutter doctor command again, you will no longer see the warning.
Read more at: https://fig.io/manual/flutter/config

Only two steps are required.
Install Visual Studio 2022 (Link: https://visualstudio.microsoft.com/downloads/)
Install Visual Studio Code (Link: https://code.visualstudio.com/)
Your code will run smoothly.

My solution was a bit simpler. Uninstall everything all build system's from VS. Then reinstall Visual Studio Community 2022, restart then try again. Might get a warning about nuget but it should fix the issue.

With the newest android installer "android-studio-2022.1.1.19-windows" there would be a jbr and jre folder existing, hence creating a link from jre to jbr would not work.
What you can do is copy the contents of the items in jbr into the jre folder and this would resolve the error.

Make sure to install Visual Studio Code.
Open the Visual Studio download page:

Related

How to install SDK for Visual Studio

I can download the iso with the SDK but which of the many *.msi do I need for C++ projects with MFC? There seemingly is no general installer included which installs the SDK on the fly.
When I installed Visual Studio 2019 I opted for C++ and MFC development and I thought that the installation of the SDK is then automatic - but somehow it was not. I de-installed and re-installed Visual Studio and then made sure that the SDK-box was checked.
Problem solved. Thanks.

TFS 2018 build fails: cannot open include file 'afxres.h'

We are testing a new new TFS 2018 SP1 server.
I was previously building a solution (4.5) which contains two unmanaged C++ projects originally written against the 2012 toolset.
Building that solution as-is on the new server worked fine. However, we have decided to retarget to 4.7.1 for our next release.
After making all the changes in the projects including targeting the 4.7.1 framework and the 2017 toolset (141), these projects fail to build with the error in the title.
I know this has to do with the C++ MFC/ATL redist.
The build server does not have VS 2017 installed and I do not want to install it unless absolutely necessary.
I did install the VS 2017 C++ redists x86 and x64 but it did not correct this.
Can anyone help me on that?
You need to at least install Build Tools for Visual Studio 2017 on your build server.
Build Tools for Visual Studio 2017
These Build Tools allow you to build native and managed MSBuild-based
applications without requiring the Visual Studio IDE. There are
options to install the Visual C++ compilers and libraries, MFC, ATL,
and C++/CLI support, and .NET and .NET Core support.
If that still not work, I'm afraid that you have to install the VS 2017 on the build server. (Note that do not miss the feature Microsoft Foundation Classes for C++ .)
UPDATE:
Please double check if you missed the Microsoft.VisualStudio.Workload.VCTools workload on the build server. See Visual C++ build tools for details.
If missed , just try using below command to install it:
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.VCTools

Xamarin.Forms Cross-Platform templates missing on Visual Studio 2015 Professional

I have fresh install of Visual Studio 2015 Professional and after click on File - New Project - Templates - Visual C# - Cross Platform I don't get any usual templates like Blank app or Cross Platform App (Xamarin.Forms or Native). I had installed all available items during Visual Studio installation and would like to target iPhone, Android and WF platform in a same project.
How to install missing templates?
All features including Xamarin were selected during initial install of Visual Studio.
I solved the issue by performing a thorough Xamarin uninstall, then I installed it again through Visual Studio installer. Details and the exact 12 steps which helped me are described here:
https://developer.xamarin.com/guides/cross-platform/windows/visual-studio/troubleshooting/uninstall-xamarinvs/
After this I got all templates needed (iPhone, Android & Windows Phone). However, after recent update of Xamarin tools I noticed that Windows Phone project isn't added to the solution any more but replaced with Universal Windows Platform.

Missing vc_runtimeminimum_x86.msi and installation won't work

I'm currently going through the installation process for Visual Studio 2017 Community Edition to use with C++. Halfway through installation, I get an error stating
"The feature you are trying to use is on a network resource that is unavailable. Click OK to try again, or enter an alternate path to a folder containing the installation package 'vc_runtimeMinimum_x86.msi' in the box below."
If I hit cancel, the procedure continues and at the end tells me that the setup has failed. It gives me the error logs attached at the bottom of this post.
Also, I have uploaded the complete logs on the Microsoft Visual Studio developer help forum here.
I'd like to be able to solve this problem without having to do a re-installation of the OS. So far, I've tried /sfc scannow, repairing through the Visual Studio Installer, and reinstalling the C++ redistributables, but all too no avail.
Any help would be greatly appreciated. Thank you.
The product failed to install the listed workloads and components due to one or more package failures. Incomplete workloads Desktop development with C++
(Microsoft.VisualStudio.Workload.NativeDesktop,version=15.0.26403.0)
Universal Windows Platform development
(Microsoft.VisualStudio.Workload.Universal,version=15.0.26403.0)
Visual Studio extension development
(Microsoft.VisualStudio.Workload.VisualStudioExtension,version=15.0.26208.0)
Incomplete components C# and Visual Basic
(Microsoft.VisualStudio.Component.Roslyn.LanguageServices,version=15.0.26208.0)
C++ profiling tools
(Microsoft.VisualStudio.Component.VC.DiagnosticTools,version=15.0.26208.0)
Graphics debugger and GPU profiler for DirectX
(Microsoft.VisualStudio.Component.Graphics.Tools,version=15.0.26208.0)
JavaScript and TypeScript language support
(Microsoft.VisualStudio.Component.JavaScript.TypeScript,version=15.0.26208.0)
Profiling tools
(Microsoft.VisualStudio.Component.DiagnosticTools,version=15.0.26208.0)
Static analysis tools
(Microsoft.VisualStudio.Component.Static.Analysis.Tools,version=15.0.26208.0)
Universal Windows Platform tools
(Microsoft.VisualStudio.Component.UWP.Support,version=15.0.26403.0)
Universal Windows Platform tools for Cordova
(Microsoft.VisualStudio.ComponentGroup.UWP.Cordova,version=15.0.26403.0)
Universal Windows Platform tools for Xamarin
(Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin,version=15.0.26403.0)
VC++ 2017 v141 toolset (x86,x64)
(Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=15.0.26208.0)
Visual Studio extension development prerequisites
(Microsoft.VisualStudio.ComponentGroup.VisualStudioExtension.Prerequisites,version=15.0.26208.0)
Visual Studio SDK
(Microsoft.VisualStudio.Component.VSSDK,version=15.0.26208.0) You can search for solutions using the information below, modify your selections for the above workloads and components and retry the installation, or remove the product from your machine. Following is a collection of individual package failures that led to the incomplete workloads and components above. To search for existing reports of these specific problems, please copy and paste the URL from each package failure into a web browser. If the issue has already been reported, you can find solutions or workarounds there. If the issue has not been reported, you can create a new issue where other people will be able to find solutions or workarounds. Package
'Microsoft.VisualCpp.Redist.14,version=14.10.25008,chip=x86' failed to install. Search URL: https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualCpp.Redist.14;PackageAction=Install;ReturnCode=1603 Impacted workloads Desktop development with C++
(Microsoft.VisualStudio.Workload.NativeDesktop,version=15.0.26403.0)
Universal Windows Platform development
(Microsoft.VisualStudio.Workload.Universal,version=15.0.26403.0)
Visual Studio extension development
(Microsoft.VisualStudio.Workload.VisualStudioExtension,version=15.0.26208.0)
Impacted components C# and Visual Basic
(Microsoft.VisualStudio.Component.Roslyn.LanguageServices,version=15.0.26208.0)
C++ profiling tools
(Microsoft.VisualStudio.Component.VC.DiagnosticTools,version=15.0.26208.0)
Graphics debugger and GPU profiler for DirectX
(Microsoft.VisualStudio.Component.Graphics.Tools,version=15.0.26208.0)
JavaScript and TypeScript language support
(Microsoft.VisualStudio.Component.JavaScript.TypeScript,version=15.0.26208.0)
Profiling tools
(Microsoft.VisualStudio.Component.DiagnosticTools,version=15.0.26208.0)
Static analysis tools
(Microsoft.VisualStudio.Component.Static.Analysis.Tools,version=15.0.26208.0)
Universal Windows Platform tools
(Microsoft.VisualStudio.Component.UWP.Support,version=15.0.26403.0)
Universal Windows Platform tools for Cordova
(Microsoft.VisualStudio.ComponentGroup.UWP.Cordova,version=15.0.26403.0)
Universal Windows Platform tools for Xamarin
(Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin,version=15.0.26403.0)
VC++ 2017 v141 toolset (x86,x64)
(Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=15.0.26208.0)
Visual Studio extension development prerequisites
(Microsoft.VisualStudio.ComponentGroup.VisualStudioExtension.Prerequisites,version=15.0.26208.0)
Visual Studio SDK
(Microsoft.VisualStudio.Component.VSSDK,version=15.0.26208.0) Log
C:\Users\Owner\AppData\Local\Temp\dd_setup_20170412231725_117_Microsoft.VisualCpp.Redist.14.log
Details Command executed:
"C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14,version=14.10.25008,chip=x86\VC_redist.x86.exe" /q /norestart /log "C:\Users\Owner\AppData\Local\Temp\dd_setup_20170412231725_117_Microsoft.VisualCpp.Redist.14.log"
Return code: 1603 Return code details: Fatal error during installation.
I ran into this problem as well on a recent build of Win 10 + trying to install latest VS Community. When I entered this state, things appeared to be super broken. Here's the sequence of events that I took which finally worked:
In the installed, select to "download all packages and then install"
Attempt installation
See the popup
With the popup still up, go here: https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed and download the tool
Open the tool and then select "Uninstall" on the page it says "do you need help installing or uninstalling"
On the next page with the list, select Microsoft Visual C++ 2015 (whatever) and hit next to "Try Uninstall"
Repeat steps 5 - 6 until I didn't see any "Microsoft Visual C++ 2015" left in the list. Note that the popup is still showing.
Close the popup
Pause the install and Resume it.
I didn't see the pop up again and it appears to have installed correctly.
If you're coming here a year after the solution was marked without any resolution, try that and see if it works around the issue for you.
Here are some other things I tried which didn't work for me. If the above didn't work for you, maybe try some of the following which I collected through some searching:
Going to C:\Program Data\Package Cache, searching for the msi package, giving the installer the literal path to what I found. Installer complains "wrong version"
Using https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed after the install failed and then repairing (same error).
Uninstalling VS 2015 packages after install failed and repairing (same error).
Ignoring the error. When I did this, VS didn't have any templates installed and devenv /installvstemplates didn't solve this.
Go to Control Panel--Programs and Features, uninstall the Visual C++ 2015 Redistribute items.
After that, run the tool: https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed. Re-run the VS 2017 installer as administrator, then click the icon besides 'Launch' and choose 'Repair' to repair the VS 2017.
This tool from Microsoft (which was mentioned by others here) worked for me, after I had been searching for an answer for days:
https://support.microsoft.com/en-us/help/17588/windows-fix-problems-that-block-programs-being-installed-or-removed
You have to choose the "I have problems uninstalling" and search for your "C++"-components (in your case the 2017 ones).
There are usually the "Minimum runtime" and the "Additional runtime"-components. After I've uninstalled both of them with this tool, I could just install a programm that uses these runtimes (for example Visual Studio) and it would download and install the missing features, after that, everything workes perfect for me.
Try installing all the things from here: https://support.microsoft.com/ms-my/help/2977003/the-latest-supported-visual-c-downloads
Not sure if you just have to install the x86 version or all of them. recommend that you install all of them but remember to uninstall the ones which you already have.
for me was simple to fix this problem.
Uninstall all visual c++ with Revo Uninstaller Pro
Use MPVCI tool. link(https://www.majorgeeks.com/files/details/multipack_visual_c_installer.html)
enjoy it. for me it works.

Visual Studio 2015 Thinks Windows 10 is Pre-Windows XP

Today I installed Visual Studio 2015 on my laptop, though I just realised I didn't make the custom install option and I cannot write code in c++ . I tried installing the c++ redistriputable , but there was an error that said I should be using windows XP or newer (although I use windows 10?!?) . I can see the c++ redistriputable pack on my computer programs though. Please help, I need visual studio for a college project! Thank you!
You will either need to re-run setup and select the required options or alternatively, navigate to the New Project window in the IDE and look for the 'Install Microsoft Foundation Classes for C++" template. Running it should install the required libraries.
Please reference the following MS guide - https://blogs.msdn.microsoft.com/vcblog/2015/07/24/setup-changes-in-visual-studio-2015-affecting-c-developers/