After updating Kotlin to 2.0, compilation of target that uses kotlinx serialization plugin, started failing with:
error: serializer has not been found for type `FooType`. To use context serializer as fallback, explicitly annotate type or property with @Contextual, where FooType comes from a different target. It fails only with experimental_use_abi_jars = True.
src/serialization/Data.kt:6:78: error: serializer has not been found for type 'plugin.serialization.AnotherData'. To use context serializer as fallback, explicitly annotate type or property with @Contextual
data class Data(val stringValue: String, val intValue: Int, val anotherData: AnotherData)
^^^^^^^^^^^
After updating Kotlin to 2.0, compilation of target that uses
kotlinx serialization plugin
, started failing with:error: serializer has not been found for type `FooType`. To use context serializer as fallback, explicitly annotate type or property with @Contextual
, whereFooType
comes from a different target. It fails only withexperimental_use_abi_jars = True
.Repro
data
target:bazel build data
Expected
Build completed successfully
Actual