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

fix: Add jvm target compatibility to Kotlin plugins #1798

Merged
merged 3 commits into from
May 10, 2023

Conversation

davidmartos96
Copy link
Contributor

@davidmartos96 davidmartos96 commented May 10, 2023

Description

When using Gradle 8+ and Kotlin version 1.8+, the build fails with the following error.
(Using the recently uploaded versions of the plugins)

image

I believe the correct fix is to indicate the jvmTarget in the kotlinOptions to all plugins that use Kotlin, same as it is done for the compileOptions with Java

kotlinOptions {
    jvmTarget = '1.8'
}

Should the compileOptions be kept in Kotlin plugins as well?

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@vbuberen
Copy link
Collaborator

Good catch. It is due to using JDK 17 with switch to AGP 8 + Gradle 8. Forgot to add it while was adding target for Java recently. Thanks for opening a PR.

@vbuberen vbuberen merged commit 1b7dc43 into fluttercommunity:main May 10, 2023
82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants