-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
auto-value 1.10.2 breaks compatibility with Kotlin 1.6 #1574
Comments
This backwards incompatible change indirectly caused Google Cloud BigQuery 2.31.0+ ( |
The |
|
I think there might be some subtlety here. If we use an old version of (I see @chaoren brought up essentially the same question.) I'm not sure what the right solution is. Perhaps make the |
Actually, if we do rewrite the metadata client code to use reflection, there's probably no reason to declare any sort of dependency on I'll look into this possibility. |
This means we don't need a dependency on that API when building AutoValue. Therefore users can freely supply the version of the API that corresponds to the actual Kotlin version they are using. The downside is that they may need to add that dependency explicitly when previously they were getting it through AutoValue. (But possibly getting the wrong version.) Fixes #1574. RELNOTES=AutoValue no longer has an explicit dependency on the Kotlin Metadata API. **You may need to add an explicit dependency on `org.jetbrains.kotlinx:kotlinx-metadata-jvm.** The reason for this change is to avoid problems that occurred when the version of the API that AutoValue bundles was different from the version that the user code expected. See #1574. PiperOrigin-RevId: 556951184
I did do the rewrite using reflection, but then realized that it isn't necessary. Many thanks to @breun for putting together the repro project. With that, I looked more closely at the error messages. As already noted in the original issue text, they look like this:
The issue is not with the copy of I'll look into getting a release out with that change in it shortly. |
We bundle a shaded copy of `kotlinx.metadata.jvm` and related libraries, which we use to inspect Kotlin data classes. The libraries are only called from Java code, which means that `META-INF/kotlinx-metadata-jvm.kotlin_module` and the like serve no purpose, other than to confuse the Kotlin compiler when it sees these entries. Fixes #1574. RELNOTES=An "incompatible version" issue with Kotlin compilation has been fixed. See #1574. PiperOrigin-RevId: 557180357
We bundle a shaded copy of `kotlinx.metadata.jvm` and related libraries, which we use to inspect Kotlin data classes. The libraries are only called from Java code, which means that `META-INF/kotlinx-metadata-jvm.kotlin_module` and the like serve no purpose, other than to confuse the Kotlin compiler when it sees these entries. Fixes #1574. RELNOTES=An "incompatible version" issue with Kotlin compilation has been fixed. See #1574. PiperOrigin-RevId: 557180357
The newly-released 1.10.3 should fix this problem. Please let me know if not. |
Thanks for the quick fix and release, 1.10.3 indeed seems to fix this issue. 👍 |
Upgrading
auto-value
from 1.10.1 to 1.10.2 in a Kotlin 1.6 project results in:The auto-value 1.10.2 release notes don't mention any Kotlin compatibility changes, but compared to version 1.10.1 compatibility with Kotlin 1.6 and 1.7 was broken.
auto-value
1.10.1 useskotlinx-metadata-jvm
0.5.0, which useskotlin-stdlib
1.7.0auto-value
1.10.2 useskotlinx-metadata-jvm
0.6.2, which useskotlin-stdlib
1.8.0auto-value
HEAD-SNAPSHOT useskotlinx-metadata-jvm
0.7.0, which useskotlin-stdlib
1.9.0Was compatibility with older Kotlin versions broken intentionally or accidentally?
The text was updated successfully, but these errors were encountered: