Flet-Fehler beim Erstellen einer Windows-AnwendungPython

Python-Programme
Anonymous
 Flet-Fehler beim Erstellen einer Windows-Anwendung

Post by Anonymous »

Jedes Mal, wenn ich versuche, den Befehl „flet build windows“ im selben Ordner zu verwenden, in dem sich mein main.py-Quellcode befindet, erhalte ich die im Screenshot gezeigte Fehlermeldung.
Ich habe Visual Studio Community bereits mit C++-Abhängigkeiten heruntergeladen.
Wie kann ich das beheben?
Ich habe bereits versucht, Visual Studio Community mit C++ zu deinstallieren und zu installieren Abhängigkeiten ohne Erfolg bei der Lösung des Problems.
Der Fehler:

Code: Select all

[13:21:28] Flutter 3.29.2 installed
[13:21:31] Packaged Python app
[13:21:37]
Building Windows application...
Building Windows application...                                  2 662ms

CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.

Unable to generate build files

[13:21:42] Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on Microsoft Windows [Version 10.0.26200.6899], locale sv-SE)
[✓] Windows Version (11 Home 64-bit, 25H2, 2009)
[✗] Android toolchain - develop for Android devices
✗ 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/to/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 (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.17)
[!] Android Studio (not installed)
[✓] VS Code (version 1.105.1)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 3 categories.

Error building Flet app - see the log of failed command above.
Die CMakeLists.txt-Datei:

Code: Select all

cmake_minimum_required(VERSION 3.14)
project(runner LANGUAGES CXX)

# Define the application target. To change its name, change BINARY_NAME in the
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
# work.
#
# Any new source files that you add to the application should be added here.
add_executable(${BINARY_NAME} WIN32
"flutter_window.cpp"
"main.cpp"
"utils.cpp"
"win32_window.cpp"
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
"Runner.rc"
"runner.exe.manifest"
)

# Apply the standard set of build settings. This can be removed for applications
# that need different build settings.
apply_standard_settings(${BINARY_NAME})

# Add preprocessor definitions for the build version.
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")

# Disable Windows macros that collide with C++ standard library functions.
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")

# Add dependency libraries and include directories. Add any application-specific
# dependencies here.
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")

# Run the Flutter tool portions of the build. This must not be removed.
add_dependencies(${BINARY_NAME} flutter_assemble)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post