Skip to content

use jvmTarget 11#313

Open
asaarnak wants to merge 13 commits into
google-pay:mainfrom
asaarnak:patch-1
Open

use jvmTarget 11#313
asaarnak wants to merge 13 commits into
google-pay:mainfrom
asaarnak:patch-1

Conversation

@asaarnak
Copy link
Copy Markdown
Contributor

No description provided.

@asaarnak
Copy link
Copy Markdown
Contributor Author

Hei! @JlUgia
Could you review this PR?
This is the last dependency for us to support jvmTarget 11.

@asaarnak
Copy link
Copy Markdown
Contributor Author

@JlUgia
I have updated the changelog and version in PR.
Could you review this?

@JlUgia
Copy link
Copy Markdown
Member

JlUgia commented Nov 18, 2025

Good day @asaarnak, thank you for your contribution.
There's no need to include release info (version and changelog) since the release lifecyle is not intimately bound to PRs.
Also, let's use the latest syntax grouping for kotlinOptions (see docs).

@asaarnak
Copy link
Copy Markdown
Contributor Author

@JlUgia
I have used flutter packages repo as a reference for tested versions and updated the build.gradle file with kotlin and jvm versions.
Also removed the deprecated kotlinOptions like you requested.
Compared against this:
https://github.com/flutter/packages/blob/main/packages/video_player/video_player_android/android/build.gradle

@JlUgia
Copy link
Copy Markdown
Member

JlUgia commented Nov 21, 2025

Good day @asaarnak this code doesn't build to me. Does it to you?
Please take a look and update to a config that builds successfully.

@asaarnak
Copy link
Copy Markdown
Contributor Author

@JlUgia What errors did you get? For us this works as a git dependency.

@asaarnak
Copy link
Copy Markdown
Contributor Author

@JlUgia
Bumped the gradle plugin like it was done here: flutter/packages@061eedc

@Robert-SD
Copy link
Copy Markdown
Collaborator

Hey @JlUgia,
pay_android JVM target became incompatibility with Flutter 3.44. Thanks @asaarnak for creating a fix and the PR!

Flutter 3.44 bumps the template Android Gradle Plugin from 8.11.1 (Flutter 3.41) to 9.0.1 (Flutter 3.44), and the Kotlin Gradle Plugin from 2.2.20 to 2.3.20 for new projects. AGP 9.x sets the Java compilation target to 11. KGP 2.x enforces that Java and Kotlin compilation targets must match (Kotlin docs).

The pay_android plugin hardcodes ext.kotlin_version = '1.8.21' and jvmTarget = '1.8' in its build.gradle. This creates a mismatch whith Java 11 that KGP 2.3.20 rejects:
We currently use AGP 8.13 which sets the Java compilation target to 11. KGP 2.3.20 detects this mismatch and fails the build:

Inconsistent JVM-target compatibility detected for tasks
'compileDebugJavaWithJavac' (11) and 'compileDebugKotlin' (1.8).

Would it be possible to merge this fix? That would be great!

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.

3 participants