Open Azka79 opened 2 months ago
I'm having the exact same problem like you have I'm running Python 3.12.2 My flet program lies in a /src/ subdir (/src/main.py)
I'm attaching the logs I'm getting when I run flet build windows src\ -vv
Hi. I had the same prob recently. It was working in the past but I decided to install a "full" version of Visual studio not only the components. Bu I forget to check the case for the installation of the desktop development tools in c++ and .net. When I installed them again and I stop to have the MSB8029 and MSB3073 errors
Thank you for your suggestion. I have tried installing the C++ and .NET development tools as you recommended, but I am still encountering the same errors (MSB8029 and MSB3073).
Could you provide a more detailed explanation on how to check if the C++ and .NET development tools are installed correctly? Is it necessary to install a previous version of MSVC? Perhaps there are specific steps or settings that I might have missed?
I had the same problem and I thought it was the reason for my app to crash after compilation, but in my case, I ignore it and my app works. A small advice, try to create a new environment and check the requirements.txt again and run, I miss one package and that was the error.
@Azka79 do you have only one Visual Build tools installed? Check also if C++ and . net development are installed using modify in the Visual Studio Installer and look if they are checked in "Desktop and Mobile" .
I had the same problem and I thought it was the reason for my app to crash after compilation, but in my case, I ignore it and my app works. A small advice, try to create a new environment and check the requirements.txt again and run, I miss one package and that was the error.
Is there a way to ignore these errors? In my case, the build folder always gets deleted when the build fails. I don't believe there's an issue with my requirements.txt
file. I've successfully published it on the web, but these errors keep appearing when I try to build windows
.
@echidne I believe I already have the necessary C++ and .NET.
Hi @Azka79 , in your screen shot the components look to be correctly installed. Do you have only one visual studio installed? In my case the prob come because I had several version installed and the one that was using flet did not have the C++ and .Net for desktop installed
Other thing to try : to get rid of problem with requirements:
-flet create helloworld
import flet as ft
def main(page: ft.Page): page.add(ft.SafeArea(ft.Text("Hello, Flet!")))
ft.app(main)
- Check in requirements.txt you have flet
- then` flet build windows`
If that works that means the visual studio components are correctly installed
Hi @echidne , I'm really sorry for the delayed response to your suggestions. I only have one version, could this cause problems? I also tried your suggestion to build on the flet create myapp . But I still get the same error
Hi @Azka79, If the simple "hello world" app is not building that means we can exclude problemes with external packages. The most logical explannation I'm able to think about is something is wrong with your VS components installation. Can you install that tool from Microsoft ? To do that type that in your Powershell Terminal :
Install-Module VSSetup -Scope CurrentUser
Choose the 'Y' option to install it.
then
Get-VSSetupInstance
and show us the result
Hi, I have the same error a few minutes ago, the solution it work for me was creating a requirements.txt on top of my application folder, inside that file I add **flet==0.22.***
Sorry for my bad english.
@echidne , I got this
InstanceId : 8caa50c6
DisplayName : Visual Studio Build Tools 2022
InstallationVersion : 17.9.34728.123
InstallationPath : C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
InstallDate : 4/8/2024 6:50:33 PM
Hi, I have the same error a few minutes ago, the solution it work for me was creating a requirements.txt on top of my application folder, inside that file I add **flet==0.22.***
Sorry for my bad english.
I think I've done that when I run flet create myapp, the requrement.txt file automatically contains flet == 0.22.*
Hi @Azka79 ,
What I did today :
Hi @Azka79 ,
What I did today :
- I Installed a Windows virtual machine to be sure to start from a fresh environment
- I installed the Visual Studio with components as stated in the medium article cited in the Flet documentations to create Windows apps and choosing the c++ and .net workloads to develop desktop apps (the same ones you picked)
- I enabled the Developer mode of windows and allow the scripts to be executed in powershell
- I installed Python 3.12 from python.org and PyCharm(to have an IDE) each time choosing the option that they are Path added
- I installed the Flutter SDK as described on their website
- In a virtual environment, I pip install flet
- then I create the helloworld app and build it .... without problems !!
- I installed the Microsoft tool to check the Visual studio installation and I obtained: So i compare to your result and I noticed that there is a difference: you have only the build tools installed when I have the community edition. I have the feeling your problem could come from that. Perhaps you could try to install teh Visual Studio community editions with the c++ and .net workloads for destop development and see if that fix your bugs?
what is your Windows 10 SDK version, i got the same issue with flet build
i can build a flutter project through the following command
flutter create test
cd test
flutter build windows
is there a build flag to specify a build target directory for flet?
@nanakura yes you can build from outside the app directory as :
flet build windows path_to_app
you can also specify where you want the build to be done as :
flet build windows -o OUTPUT_DIR
@nanakura yes you can build from outside the app directory as :
flet build windows path_to_app
you can also specify where you want the build to be done as :
flet build windows -o OUTPUT_DIR
-o
flag does not work in my computer, and i find some log
It looks like the build error is caused by cmake not finding vcruntime140_1.dll
, but I can find this file on the disk
hi @nanakura ,
What version of visual studio is installed in your system?
Please show a result of the flutter doctor -v
command
You say its the -o that causes the error but the error look to happen at building app step not when the build is copyed to the ouput_dir.
Perhaps posting the full log of the building coudl help to know what is happening (you can obtain it in adding the --verbose flag)
I'm not very experimented with Flet but I can try help you.
hi @nanakura , What version of visual studio is installed in your system? Please show a result of the
flutter doctor -v
command You say its the -o that causes the error but the error look to happen at building app step not when the build is copyed to the ouput_dir. Perhaps posting the full log of the building coudl help to know what is happening (you can obtain it in adding the --verbose flag) I'm not very experimented with Flet but I can try help you.
I didn't mean that this error was caused by "-o". Instead, I meant that the build process of flet is performed in the tmp path, and flet deletes the build files after a build failure. I encountered the exact same issue as @Azka79. Here is my flutter doctor -v
:
C:\Users\reika>flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure
you trust this source!
[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [版本 10.0.22631.3593],
locale zh-CN)
• Flutter version 3.22.1 on channel stable at D:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (2 weeks ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[√] Windows Version (Installed version of Windows is version 10 or higher)
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit
https://flutter.dev/docs/get-started/install/windows#android-setup for
detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio 生成工具 2022 17.10.1)
• Visual Studio at d:\Program Files (x86)\Microsoft Visual
Studio\2022\BuildTools
• Visual Studio 生成工具 2022 version 17.10.34928.147
• Windows 10 SDK version 10.0.22621.0
[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit
https://flutter.dev/docs/get-started/install/windows#android-setup for
detailed instructions).
[√] VS Code (version unknown)
• VS Code at C:\Users\reika\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
X Unable to determine VS Code version.
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本
10.0.22631.3593]
• Chrome (web) • chrome • web-javascript • Google Chrome
124.0.6367.209
• Edge (web) • edge • web-javascript • Microsoft Edge
125.0.2535.92
hi again @nanakura, since you said that you could build from a test app and directory but after you said -o flag was not working for you I assumed that the error you shown was raized by the -o flag. AS I said to @Azka79 the difference I note beetween my working environment and yours is that I'm using Visual Studio Community Edition and not only the components I had problems when I was using components but that problemes stopped when i installed the Community edition.
hi again @nanakura, since you said that you could build from a test app and directory but after you said -o flag was not working for you I assumed that the error you shown was raized by the -o flag. AS I said to @Azka79 the difference I note beetween my working environment and yours is that I'm using Visual Studio Community Edition and not only the components I had problems when I was using components but that problemes stopped when i installed the Community edition.
you are right. I installed the Visual Stusio Community Edition and build success
Have installed the Visual Studio and VS Tool only C++ as here in screenshot.
Activate Virtual environment and build the windows app with command "flet build windows" using the Powershell from Visual Studio as shown in screenshot. App build will become successfull.
I get a problem every time I do a
flet build windows
. I've tried upgrading my Flutter and Visual Studio. I even tried changing my TEMP file, but the error warnings MSB8029 and MSB3073 kept appearing. What should I do?here is the error log:
The information from my
flutter doctor
does not show any errors and the version of flet is 0.22.0