Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"Cannot inline bytecode" error in KMP project module #762

tellypresence started this conversation in General
Discussion options

(Note: this is not a project bug, just a fix for a nasty error encountered during use that others may run into; leaving breadcrumbs here in case anyone else is looking for answers)

If you are using gitlive firebase in a KMP (Kotlin Multiplatform) project module and your (android) build breaks with error e.g.

Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 1.8. 
Specify proper '-jvm-target' option.

the fix consists of 2 things:

  • Add jvmToolchain in kotlin block of build.gradle.kts
  • Check for installed JDK 17 and if not present, download and install

The usual workflow of setting JDK version in android studio "Project Structure" settings isn't supported for KMP modules; for kmp module the solution should be as simple as adding jvmToolchain() in kotlin block in build.gradle.kts

kotlin {
 jvmToolchain(17)

Also run this command in terminal (Android Studio terminal should work fine)

/usr/libexec/java_home -V

If JDK 17 not displayed in command output, download from e.g. oracle and install; should be picked up without any further steps required

You must be logged in to vote

Replies: 1 comment

Comment options

I’m hitting the same issue here. I switched to JDK 17 and added jvmToolchain(17) in the KMP module, but the build still fails with the same error. Has anyone managed to resolve this or found an alternative fix?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #736 on August 20, 2025 10:28.

AltStyle によって変換されたページ (->オリジナル) /