You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have enabled test fixures in my Android project, which is working.
However, when I try to create a class annotated with @Serializable in the testFixtures source set, the serializer doesn't seem to be available in my test:
kotlinx.serialization.SerializationException: Serializer for class 'MyClass' is not found.
Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.
at kotlinx.serialization.internal.Platform_commonKt.serializerNotRegistered(Platform.common.kt:90)
at kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:299)
at kotlinx.serialization.SerializersKt.serializer(Unknown Source)
at androidx.navigation.NavDestinationBuilder.<init>(NavDestinationBuilder.kt:91)
...
When I place the same class in the test source set, the serializer is available in my test.
Describe the bug
I have enabled test fixures in my Android project, which is working.
However, when I try to create a class annotated with
@Serializable
in thetestFixtures
source set, the serializer doesn't seem to be available in my test:When I place the same class in the
test
source set, the serializer is available in my test.To Reproduce
// project level build.gradle.kts plugins { alias(libs.plugins.kotlin.serialization) } dependencies { testImplementation(libs.kotlinx.serialization.json) testFixturesImplementation(libs.kotlinx.serialization.json) }
Expected behavior
When I move the
@Serializable
class from thetest
source set totestFixtures
, the serializer is still available in my test.Environment
The text was updated successfully, but these errors were encountered: