Fixed
Status Update
Comments
bi...@google.com <bi...@google.com>
im...@google.com <im...@google.com>
bi...@google.com <bi...@google.com>
bi...@google.com <bi...@google.com> #2
This work is about taking into account configurations from Gradle toolchain for our Java compilation task and it is not a critical bug. Moving it to 7.3
bi...@google.com <bi...@google.com> #3
Fixed with I425ad9e479a3eb7481d05c2dc769a9befecf84d4
ju...@veepee.com <ju...@veepee.com> #4
Was this released in AGP ? What version? How to configure?
bi...@google.com <bi...@google.com> #5
It is available since AGP 7.4 alpha05 and the fix is to use gradle tool chain to configure java compilation task.
Like to use the following dsl to make your code compile with java 11
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
ju...@veepee.com <ju...@veepee.com> #6
Where to place it? In the root build.gradle ? In each module of the project? Should it be inside the android
block ?
ju...@veepee.com <ju...@veepee.com> #7
bi...@google.com <bi...@google.com> #8
re #6, not in the android block, please refer to gradle's document about using java tool chain.
to...@gmail.com <to...@gmail.com> #9
ONIT101EVERYTHING.COM MY BUSINESS IN GOOGLE
Description
If I am setting Java toolchain via extension:
JavaCompile
tasks created by AGP are still using current Gradle daemon JDK and not configured toolchain one.It is possible to workaround by explicitly setting toolchain for all
JavaCompile
tasks:Version of Gradle Plugin: 7.0.0-beta05 Version of Gradle: 7.1.1 Version of Java: 11.0.11 OS: Linux
Steps to Reproduce:
app/build.gradle
file:./gradlew :app:assembleDebug -i
using JDK 11 and check task:app:compileDebugWithJavac
logs for lineCompiling with toolchain
- it should point to the configured toolchain JDK 15 and not current Gradle daemon JDK 11.