Skip to content
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

Ensure Android Java and Kotlin compile to the same version #61579

Merged

Conversation

madmiraal
Copy link
Contributor

Currently there is a mismatch between the Java and Kotlin classes compilation version targets. Java classes are being compiled using Java version 11, but the Kotlin classes are being compiled to be compatible with Java version 1.8.

This is the warning generated by the Gradle build:

'compileTemplateReleaseJavaWithJavac' task (current target is 11) and 'compileTemplateReleaseKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.

This PR ensures that Java and Kotlin classes are compiled to the same Java version: 11.

Comment on lines -2 to -3
apply from: 'config.gradle'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed when doing gradle builds in the Godot Editor since in that environment, the app/build.gradle is the root gradle build file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the PR to include apply from: 'config.gradle' below the plugins DSL block (it can't go above).

To get everything to work properly using the plugins DSL, I also needed to update the settings.gradle file for plugin management to enable code based version selection.

I've now tested both the Editor custom build export, and an Android Studio build of the editor to confirm everything works.

@madmiraal madmiraal force-pushed the android-kotlin-java-version branch from fd2a9b0 to b19bbad Compare June 1, 2022 15:23
@akien-mga akien-mga merged commit cd78718 into godotengine:master Jun 1, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants