How to build release version of windows app in flutter and where to find the build file ?
Actually I have build the windows app using flutter build windows but am not able to locate the file which could to installed to other desktops and could be used further on .
Flutter doctor output :-
H:\window app flutter\windowsapp>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.22.0-2.0.pre.36, on Microsoft Windows [Version 10.0.18363.1082], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.5)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.50.0)
[√] Connected device (4 available)
• No issues found!
Please help 🙂
Flutter 2.10 arrives with stable support for building Windows app.
You can use flutter build windows and it will do the build for you.
Make sure to install Desktop development with C++.
The build .exe file can be found on ...\projectName\build\windows\runner\Release\
You can use msix package for build. To build using msix you need to enable developer mode on Windows.
Type start ms-settings:developers and it will open the setting and enable it.
Open Command prompt (as Administrator if you needed) and navigate to your project directory and type these command
flutter build windows
flutter pub run msix:create
You will get an .msix app that will install the usual way windows does.
You can also configuring your installer.
For more details go to https://flutter.dev/desktop
The executable can be found in your project under
build\windows\runner<build mode>. In addition to that executable,
you need the following:
From the same directory:
all the .dll files
the data directory
The Visual C++ redistributable
You can use any of the methods shown in the deployment example walkthroughs on the Microsoft site.
If you use the application-local option, you need to copy:
msvcp140.dll
vcruntime140.dll
vcruntime140_1.dll
Place the DLL files in a directory next to the executable and the other DLLs, and bundle them together in a zip file.
Yes!
So I found the release build in this folder after executing flutter build windows :-
windowsapp\build\windows\runner\Release
Here windowsapp is the main app directory
Note - For further distribution you'll need to zip the content present
inside the Release folder and distribute the same zipped file.
Related
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.
How to change the installation location in VS2017, currently its showing in the gray shade (Read-only) like:
Please check this doc: Change the installation locations in VS 2017 and those locations is set with your first installation and cannot be changed later from the installer UI. If you just want to move the download cache, you can use command-line parameters and for others, please try to clean up the installed VS like the following and re-install it:
• See if you have this file on your machine: "%programfiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe"
• If so, please launch it from an admin command prompt with a -full param:
InstallCleanup.exe -full
• If not, please manually delete the "%programfiles(x86)%\Microsoft Visual Studio\Installer” folder
• Relaunch the newly downloaded vs_enterprise.exe (or vs_professional.exe or vs_community.exe…)
• Allow the first step to install the installer
• Once the installer comes up and you can see workload choices (.net desktop and the like), close it
• Go launch the same InstallCleanup.exe to clean up old build of VS
• Then re-run the VS installer to install
BTW, this method can reduce the installation footprint on your system drive but there are some tools and SDKs that have different rules on where they can be are installed. These tools and SDKs will still be installed on your system drive even if you choose another location.
Unfortunately, I set incorrect path for flutter sdk on Visual Studio and now I am trying to reset the path , but can't , Is it possible to reset ?
Visual Studio said :
Warning! The 'flutter' tool you are currently running is from a
different Flutter repository than the one last used by this package.
The repository from which the 'flutter' tool is currently executing
will be used instead. running Flutter tool: /home/zayniddin/flutter
previous reference :
/home/zayniddin/Downloads/flutter_linux_v0.7.3-beta/flutter This can
happen when you have multiple copies of flutter installed. Please
check your system path to verify that you are running the expected
version (run 'flutter --version' to see which flutter is on your
path).
After changing the Path in your machine,
run flutter upgrade. Weird but works for me
I have a cordova app on visual studio 2017. VS2017 uses Cordova 6.3.1 however I need to use Cordova version 7.1.0.
So I had to install cordova globally as specified in this link https://evothings.com/doc/build/cordova-install-windows.html
Then I opened config.xml from my project and went to change Toolset Name, but it shows "Global Cordova Version (not currently installed)"
Any help to fix this issue?
If you have already installed Node.js, you can install Cordova 7.1.0 by typing this in a command line interface window (cmd.exe):
npm install -g cordova#7.1.0
Now, because changing the CLI version is not as reliable as we would want, I suggest to follow these steps to create your new app in Visual Studio 2017:
Go to File > New > Project > Blank App (Apache Cordova)
Open config.xml in View Code mode and find this:
<vs:toolsetVersion>6.3.1</vs:toolsetVersion>
<engine name="android" spec="5.2.1" />
Replace with:
<vs:toolsetVersion>7.1.0</vs:toolsetVersion>
<engine name="android" spec="6.3.0" />
Where 7.1.0 is your globally installed Cordova version.
Select Device as target.
Now Build > Build Solution
Save, close and reload the project. When you access config.xml in designer mode you'll see Global Cordova 7.1.0 as the selected toolset.
In order to build you may need to use the external Android SDK Build Tools (API 26) instead of the ones provided by Visual Studio (API 25).
Use the Android SDK Manager to manage versions, no need to get Android Studio for this.
Remember to follow the guidelines from Microsoft when changing the CLI on existing projects. However I strongly recommend creating a new one and then importing your files and adding your plugins to avoid potential problems.
What steps i followed:
Deleted SDK folder placed on MAC after installing Android Studio
Copy SDK folder from windows and pasted it on same location as previous SDK folder was placed .
Now Following Errors Keeps occurring:
When Rebuilding Project Gradle Build Error
When Clicking on StandAlone SDK manager Not found "my path" error=2 something something
When clicking on Run button exception adb not found occur
And many other issues
My Attempts in resolving issues:
1 - Installed All Gradle build latest and previous and tried to change my buildToolsVersion and support appcompat v7 on all of them finally one worked, build version 23.0.0 which is installed. (Hope Fully Resolved Gradle Build Error)
2 - Manually installed Tools folder for mac and replaced it with Tools folder in SDK folder
3 - Tried to Bribe my laptop and Android Studio , didn't work out though
Now why i did something like this? To save my bandwidth i have 78GB of SDK folder in windows and didn't want to waste my bandwidth installing all SDK's again , so Kindly suggest a workaround/solution