-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Issue while running ./gradlew build #910
Comments
It looks like you might be trying to use JDK 11 to build Now in Android? Building Now in Android requires JDK 17 or later. |
The logs you give us are the raw logs of the build.
And the last two lines are links to configure the JDK. That being said, we could override this behavior and force checking for the appropriate version (and maybe only if if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17).not()) {
throw GradleException(
"""
Now in Android requires JDK 17 but it is currently using JDK ${JavaVersion.current()}.
Java Home: [${System.getProperty("java.home")}]
""".trimIndent()
)
} WDYT? |
Agree with your suggested fix @SimonMarquis. Only thing I would add is that the message should also provide a solution (e.g., #1137 (comment)). Feel free to submit a PR. |
I feel like the fix should not be to manually edit config files, but instead to use the Android Studio UI ( https://developer.android.com/build/jdks and more precisely this https://developer.android.com/build/jdks#jdk-config-in-studio |
Sounds good to me. Just use that link in the error description. |
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 android#910
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
Issue while running ./gradlew build
Relevant logcat output
Code of Conduct
The text was updated successfully, but these errors were encountered: