下面提到了Java路径和我收到的错误。并且我正确设置了JAVA_HOME sdk版本。也许 flutter sdk 旧了?
1.
C:\Users\ASUS>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.4894], locale tr-TR)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/windows-android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.3)
[√] Android Studio (version 2021.3)
[√] VS Code (version 1.94.0)
[√] Connected device (3 available)
[√] Network resources
! Doctor found issues in 1 category.
C:\Users\ASUS>flutter doctor --android-licenses
Java version 17 or higher is required.
To override this check set SKIP_JDK_VERSION_CHECK
C:\Users\ASUS>java -version
java version "19" 2022-09-20
Java(TM) SE Runtime Environment (build 19+36-2238)
Java HotSpot(TM) 64-Bit Server VM (build 19+36-2238, mixed mode, sharing)
C:\Users\ASUS>where java
C:\Program Files\Java\jdk-19\bin\java.exe
Flutter 似乎无法正确识别您的 Java 版本。您应该尝试以下一些步骤来解决该问题:
JAVA_HOME
:确保它指向JDK 19安装目录。Path
变量:确保 C:\Program Files\Java\jdk-19\bin
已正确添加到您的 Path
环境变量中。flutter doctor
flutter doctor --android-licenses