1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Java use the sdk path does not exist anymore even after restar restart computer,...

Discussão em 'Mobile' iniciado por Stack, Outubro 31, 2024 às 10:13.

  1. Stack

    Stack Membro Participativo

    So I installed wrong version java at first (jdk-19) then I unintall that and installed the latest (jdk-23). After I install, I do

    In System Envariables,

    set JAVA_HOME

    https://i.sstatic.net/TfMEAwJj.png

    set Path

    https://i.sstatic.net/Cbby04Xr.png

    Then I restart my laptop

    Open VScode, run

    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:\SDK\Java\jdk-19 is my old path but I deleted that before I installed jdk-23 and I chose the default path.

    But why it show C:SDKJavajdk-19 not C:\SDK\Java\jdk-19

    Continue reading...

Compartilhe esta Página