Skip to content

Need the ability to configure Java version when building Android app on per-project basis #7815

@miklcct

Description

@miklcct

Thanks for the feedback! If your issue is related to the Flutter framework itself,
please open an issue at
github.com/flutter/flutter.

Steps to Reproduce

  1. Install IntelliJ IDEA, Android and Flutter plugins.
  2. Download a few versions of Java JDK in IntelliJ IDEA, and add one of them into the PATH.
  3. Install Android SDK using IntellliJ IDEA.
  4. Build a Flutter app using a Gradle version which is compatible to one of the JDKs installed, but not the one in the PATH.

The Android app will fail to build because the Java version is not compatible. As different Flutter apps can use different Gradle versions, I need to configure the JDK version on the Android app on a per-project basis.

Related: flutter/flutter#159411

Version info

'''
[√] Flutter (Channel stable, 3.24.5, on Microsoft Windows [Version 10.0.22621.4460], locale en-GB)
• Flutter version 3.24.5 on channel stable at C:\Users\Michael\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision dec2ee5c1f (12 days ago), 2024-11-13 11:13:06 -0800
• Engine revision a18df97ca5
• 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 34.0.0)
• Android SDK at C:\Users\Michael\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Users\Michael.jdks\openjdk-23.0.1\bin\java.exe
• Java version OpenJDK Runtime Environment (build 23.0.1+11-39)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.12.1)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
• Visual Studio Build Tools 2022 version 17.12.35514.174
• Windows 10 SDK version 10.0.22621.0

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/windows-android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2024.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2024.3
• Flutter plugin version 82.2.4
• Dart plugin version 243.22562.3

[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.4460]
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.86
• Edge (web) • edge • web-javascript • Microsoft Edge 131.0.2903.63

[√] Network resources
• All expected network resources are available.

! Doctor found issues in 1 category.
'''

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions