В системных переменных
устанавливаю JAVA_HOME
https://i .sstatic.net/TfMEAwJj.png
установить путь
https://i.sstatic.net/Cbby04Xr.pngЗатем я перезагружаю свой ноутбук
Открываю VScode, запускаю
Код: Выделить всё
flutter doctor -v
[√] Flutter (Channel stable, 3.24.4, on Microsoft Windows [Version 10.0.22631.4391], locale en-US)
• Flutter version 3.24.4 on channel stable at C:\SDK\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 603104015d (7 days ago), 2024-10-24 08:01:25 -0700
• Engine revision db49896cf2
• Dart version 3.5.4
• DevTools version 2.37.3
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at C:\Users\thong\AppData\Local\Android\sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: C:SDKJavajdk-19\bin\java
X Cannot execute C:SDKJavajdk-19\bin\java to determine the version
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.5)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.11.35327.3
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2024.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
[√] VS Code (version 1.95.0)
• VS Code at C:\Users\thong\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.98.0
[√] Connected device (4 available)
• V2342 (mobile) • 10AE3E1GYQ000KX • android-arm64 • Android 14 (API 34)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.4391]
• Chrome (web) • chrome • web-javascript • Google Chrome 130.0.6723.70
• Edge (web) • edge • web-javascript • Microsoft Edge 130.0.2849.56
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
flutter analyze --suggestions
┌───────────────────────────────────────────────────────────────────┐
│ General Info │
│ [√] App Name: getx_flutter │
│ [√] Supported Platforms: android, ios │
│ [√] Is Flutter Package: yes │
│ [√] Uses Material Design: yes │
│ [√] Is Plugin: no │
│ [X] Java/Gradle/Android Gradle Plugin: │
│ Incompatible Java/Gradle versions. │
│ Java Version: null, Gradle Version: 8.3 │
│ │
│ See the link below for more information: │
│ https://docs.gradle.org/current/userguide/compatibility.html#java │
│ │
└───────────────────────────────────────────────────────────────────┘
flutter doctor --android-licenses
ERROR: JAVA_HOME is set to an invalid directory: C:SDKJavajdk-19
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Android sdkmanager tool was found, but failed to run (C:\Users\thong\AppData\Local\Android\sdk\cmdline-tools\latest\bin\sdkmanager.bat): "exited code 1".
Try re-installing or updating your Android SDK,
visit https://flutter.dev/to/windows-android-setup for detailed instructions.
Но почему он показывает C:SDKJavajdk-19, а не C:\SDK\Java\jdk-19
Подробнее здесь: https://stackoverflow.com/questions/791 ... t-computer
Мобильная версия