Skip to content

com.google.maps.android:maps-ktx:5.1.0 requires Java 17 runtime #266

@mateuszkwiecinski

Description

@mateuszkwiecinski

Thanks for stopping by to let us know something could be better!


PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


Please be sure to include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ..."): Kotlin Compiler
  2. OS type and version: Yes
  3. Library version and other environment information: `com.google.maps.android:maps-ktx:5.1.0

Steps to reproduce

  1. Have an build that produces java 11 compatible bytecode i..e
android.kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()

or whatever it is preferred these days
2. Call com.google.maps.android.ktx.awaitMap in the source code
3. Compile the app
image

Expected: The project compiles just fine
Actual: compileDebugKotlin fails with Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 11. Please specify proper '-jvm-target' option.

My reasoning why this is a bug:

  • Such breaking change was released in minor version bump. I'm not sure which java version targets 5.0.0 but it compiles just fine for a project targeting Java 11
  • Release notes don't mention that change at all
image
  • only some of Java 11 and 17 APIs are available via desugaring on Android, we're still far from most of the devices being able to run (even desugared) Java 17 code. Plus desugaring isn't yet enforced or even enabled by default
  • According to https://developer.android.com/build/jdks#compileSdk Java 17 runtime is available only starting from API 34

More insights:

Related articles:

Code example

# example
fun repro(map : com.google.android.gms.maps.MapView) = map.awaitMap()

Stack trace

# example
`Cannot inline bytecode built with JVM target 17 into bytecode that is being built with JVM target 11. Please specify proper '-jvm-target' option.`

Following these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions