1

This is what my android/app/build.gradle.kts file looks like (only a portion shown):

android {
 ... ...
 ... ...
  compileOptions {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
  }
 ... ...
 ... ...
} 

The project uses default values for other important config options, which are determined by file ``:

open class FlutterExtension {
 val compileSdkVersion: Int = 36
 val minSdkVersion: Int = 24
 val targetSdkVersion: Int = 36
 val ndkVersion: String = "27.0.12077973"
 ... ...
 ... ...
 ... ...
}

The AGP version is: "8.9.1"

Use this table to determine which Java version is supported by each Android API, and where to find details on which Java APIs are available.

(Source: Java versions in Android builds)

Android Java
14 (API 34) 17
13 (API 33) 11
12 (API 32) 11

I am trying to understand what sourceCompatibility and targetCompatibility options are in order to be able to configure them properly for my projects. As you can see my project targets API 36 but the Java version used is VERSION_11. So, I suppose this table given in official documentation shows maximum supported Java version! Please correct me if I am wrong. I read somewhere that source and target compatibility of Java also determines the Android Runtime (ART). How to select these versions for (1) scalability, (2) latest features?

asked 17 hours ago

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.