Check Java version compatibility

And abort current build with a message containing current Java version and a link to the official docs on how to setup the correct Java version.

Fixes #910
pull/1671/head
Simon Marquis 2 months ago committed by GitHub
parent a01289df2d
commit f8b40c37ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -63,3 +63,11 @@ include(":lint")
include(":sync:work") include(":sync:work")
include(":sync:sync-test") include(":sync:sync-test")
include(":ui-test-hilt-manifest") include(":ui-test-hilt-manifest")
check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
"""
Now in Android requires JDK 17+ but it is currently using JDK ${JavaVersion.current()}.
Java Home: [${System.getProperty("java.home")}]
https://developer.android.com/build/jdks#jdk-config-in-studio
""".trimIndent()
}

Loading…
Cancel
Save