Skip to content

Retrofit 3.0.0 and 2.12.0 Kotlin compatibility issue with Spring Boot 3.4.5 (Kotlin 1.9.25) #4381

Open
@lthoulon-locala

Description

@lthoulon-locala

Hi,

Thanks for the release of Retrofit 3.0.0, it's great to see the OkHttp update.

I'm encountering a compatibility issue with the Kotlin version used in Retrofit 3.0.0 when integrating it with a Spring Boot application. Spring Boot currently provides Kotlin 1.9.25.
Upon updating to Retrofit 3.0.0, I receive the following error:

.m2/repository/com/squareup/retrofit2/retrofit/3.0.0/retrofit-3.0.0.jar!/META-INF/retrofit.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.

My project relies on the Kotlin version managed by Spring Boot, and I'm unable to change it independently due to potential compatibility issues with other dependencies.

Based on my understanding, Kotlin 1.9.25 should be compatible with libraries compiled with Kotlin up to version 2.0.0.

Given that Spring Boot isn't expected to include Kotlin 2.1.0 support before their next major version, would it be possible to compile Retrofit 3.0.0 to be compatible with Kotlin 1.9.x? This would allow Spring Boot users to adopt Retrofit 3.x without waiting for a Spring Boot major release.

As a side note, I noticed that OkHttp 4.12 appears to be based on Kotlin 1.8 according to their changelog.

I appreciate your consideration and hope this compatibility can be addressed.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions