Flutter windows build: Nuget is not installed - windows

I uninstalled Visual Studio 2019 and installed it as 2022.
I reinstalled Flutter.
When building Flutter desktop, the following problem is repeated.
If I run it in another project, it works without any problem.
Launching lib\main.dart on Windows in debug mode...
Building Windows application...
Nuget is not installed.
Nuget.exe not found, trying to download or use cached version.

1- make sure you have installed Visual Studio
2-
NuGet Package Manager (PM UI and PM Console) is included with Visual
Studio. The latest NuGet releases are delivered as part of Visual
Studio updates.
HOWEVER: nuget.exe itself is not included with any version of Visual Studio.
so you need to download the latest NuGet Windows x86 Commandline from https://www.nuget.org/downloads
3- put it inside the flutter sdk folder or any folder you like
4- copy the folder path
5- in windows serach, search for env so you can put it as system variables. edit path with a new line and past the folder path
6- restart android studio
7- congrats
there's a video on youtube for the exact steps:
https://www.youtube.com/watch?v=J5b5sj6mG8M

Although I don't know why it would work without this error message on the same machine, I recently ran into this issue as well. The way I fixed it was to download the nuget executable and add it to my path.

Related

Unable to install visaul studio properly and toolchains required for unity

After a fresh windows 11 install I haven't been able to get visual studio and building a game in unity to work.
Visual Studio 2019:
After I install visual studio with the correct modules for unity. it shows up in the installer as "installed" but when I turn of or restart my computer it does not show under the Installed section. Also when I open visual studio it gives a "Failed to load common IDE package" error. Referring to a file in: C:\Users"user"\AppData\Roaming\Microsoft\VisualStudio\16.0_971410d4.
I have tried:
Repairing visual studio.
Repairing visual studio and deleting the before mentioned directory.
Complete reinstall of the installer and visual studio.
Unity:
When I try to build my game I get this error: error:
Could not set up a toolchain for Architecture x64. Make sure you have the right build tools installed for il2cpp builds. Details:
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ().
I have tried:
Reinstalling the current engine version (Unity 2021.2.13f).
Upgrading the engine version to (Unity 2021.2.14f).
Reinstall Unity 2021.2.14f.
I think these two problems are tied together but I'm not sure.
~ Rasl2002
I fixed my problem.
https://developercommunity.visualstudio.com/t/access-denied-for-visual-studio-common-ide-package/962361
this link leads to the solution. you need to run:
icacls "C:\ProgramData\Microsoft" /reset /T /C
in an admin terminal.

Found .NET SDK, but did not find dotnet.dll

I recently installed Visual Studio 2022 preview.
Today I was in a workshop and there was some feature that didn't work, and it turned out it was because I had the preview version of .NET 6 installed.
So I then uninstalled Visual Studio 2022 preview.
Now, when I type dotnet --version (or other command like dotnet --info) in a command window, I get the following message:
Found .NET SDK, but did not find dotnet.dll at [C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\dotnet.dll]
I have tried to repair, and then reinstall DotNet SDK 5.0.400. Restarted machine a few times as well, to no avail.
I am guessing the uninstaller removed the files, but failed to restore the registry to the previous version.
How do I fix this?
So right after posting my question, I discovered that the uninstaller had left some leftovers on my disk. There was a folder with some files, called 6.0.100-preview.7.21379.14. After I deleted it, the command "dotnet --version" now returns "5.0.400".
As Mak wrote below, the folders mentioned reside inside this folder:
C:\Program Files\dotnet\sdk
I also ran into the same problem recently. I had to go to the below path in Windows and delete all 6.*.* folders.
C:\Program Files\dotnet

Where to get Android Studio Artic Fox uninstall.exe file?

Currently, I've had some issues with android studio plugins not working correctly so I tried to uninstall and reinstall android studio but it failed as the uninstall.exe is missing. I've directly located and uninstalled most of the files for android studio and reinstalled it but the same thing occurred where no uninstall.exe was on the directory. I tried to use the new installer to see if it would give me the option to uninstall the pre-existing version but it didn't work. Also, I tried to download the zip contain the files of android studio instead of the recommended installer but there was no uninstall.exe.

Visual Studio 2017, Download Offline [duplicate]

I recently try to install Visual Studio 2017. But there is no offline installer. How to get offline installer for it.
I also tried to install Xamarin. Eventhough I have latest Android SDK, it ask me to download Android SDK again. How to rectify it?
Thanks in advance.
To produce an offline installer you first need to download the corresponding online installer, which will give you an installation file similar to one of these:
vs_enterprise.exe - Visual Studio 2017 Enterprise, download here
vs_professional.exe - Visual Studio 2017 Professional, download here
vs_community.exe - Visual Studio 2017 Community Edition, download here
Then all you have to do is this:
vs_WHATEVER.exe --layout path-to-empty-directory
Example, to create an offline installer for Visual Studio 2017 Community Edition you first download the online installer, then you execute this:
vs_community.exe --layout d:\temp
This will fill D:\Temp with all the files necessary to install Visual Studio.
Note: The installer will open a console window as part of its process, you need to wait until this window closes before you can safely use the contents of this folder.
There will be many sub-directories, depending on the packages available, but you will also have the original executable you downloaded placed into this directory. Executing this from this directory will install using the provided packages.
Also note that by default, unless you manually specify --add and package id's, all the packages will be downloaded. You will thus get a complete and current version to install offline. However, if you specify packages with the --add parameter, only the specified packages will be downloaded.
Source: Create a network installation of Visual Studio 2017

Xamarin vstool build cannot find NuGet MSBuild targets

Background
I recently converted my Xamarin.Forms app from PCL to Net Standard format.
All of my projects now use PackageReference in the csproj file. Which means no more package.config or package.json.
We use TFS 2015 to build, sign, package our .ipa and .apk files. After conversion, the default MSBUILD build steps do not work as they look for mdtool and the new Visual Studio has vstool instead. So, I updated the build steps to use new tools via command line.
All my projects are NetStandard now (including iOS and Android).
Issue
I can successfully restore NuGet packages using restore MySolution.sln -force on Mac build server. But when I run vstool build MySolution.sln after that, I get this error:
error: NuGet packages need to be restored before building. NuGet
MSBuild targets are missing and are needed for building. The NuGet
MSBuild targets are generated when the NuGet packages are restored.
I am able to successfully run the nuget restore and vstool build locally on the build machine. But only when TFS runs the command via agent, it shows that error message.
Setup
Builds: TFS 2015 on Mac agent running Visual Studio 7.5
According to the error and your description, you need also check if your build agent has corresponding capability to support vsbuild.
Take a look at this related question MacOS - Visual Studio Support and give a try with this workaround:
As a work around we set the Xamarin.iOS variable manually in the build
agent and changed the mdtool path in the Xamarin iOS Build step to
"/Applications/Visual Studio.app/Contents/MacOS/vstool".
Besides you could also try to use the suggestion from Matt in the comment above.
Ok. I was finally able to get a successful iOS build on Mac server. This is the setup that works,
Using PackageReference in iOS .csproj
No package.config, project.json, or AssemblyInfo.cs file.
Running nuget restore .sln before building the iOS project.
Build solution using <path-to-vstool>\vstool build .sln -c:<configuration>
Now, I am working on the Windows machine for Android setup. Once I have that working, I will post my findings here.

Resources