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

[Flutter] How to change android Studio Java version?

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

  1. Stack

    Stack Membro Participativo

    I want to change the Java version used by android Studio.


    When I run my flutter app, It doesnt go and here it what I get as output message. Flutte Fix [!] Your project's Gradle version is incompatible with the Java version that Flutter is using for Gradle.

    This is somehow bizzare, because I checked in gradle's documentation, my gradle version 7.5 is compatible with the java version that I have 20.0.0

    But It seems my Android studio (Android Studio Giraffe 2022.3.1 , The latest version as of September 2023) is taking into consideration another Java version, which is 17.

    Here is the output when I run java -version

    Java(TM) SE Runtime Environment (build 20.0.2+9-78)
    Java HotSpot(TM) 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)```

    And here is the output of `flutter doctor -v`
    ```[✓] Flutter (Channel stable, 3.13.4, on macOS 12.6.3 21G419 darwin-x64, locale en-CM)
    • Flutter version 3.13.4 on channel stable at /Users/baimamboukar/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (7 days ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/baimamboukar/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

    [!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    ✗ Flutter requires Xcode 14 or higher.
    Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.3

    [✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 17.0.6+0-17.0.6b829.9-10027231)

    [✓] VS Code (version 1.82.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.72.0

    [✓] Connected device (3 available)
    • JKM LX2 (mobile) • 192.168.43.1:5555 • android-arm64 • Android 9 (API 28)
    • macOS (desktop) • macos • darwin-x64 • macOS 12.6.3 21G419 darwin-x64
    • Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.187

    [✓] Network resources
    • All expected network resources are available.```

    Continue reading...

Compartilhe esta Página