goku
07/11/2023, 6:54 AMApolloJsonParser.parseJsonResponse()
to create mock data from Json for Compose Previews and I’m getting this error. Has anyone experienced this?
TIA
java.lang.NoSuchFieldError: Companion
at com.apollographql.apollo3.api.json.BufferedSourceJsonReader.<clinit>(BufferedSourceJsonReader.kt:855)
bod
07/11/2023, 7:52 AMgoku
07/12/2023, 1:48 AMv3.8.1
I’ve seen this error being reported on Github and it was caused by version conflict between Okhttp I believe. But the problem here is that it works fine when you run the project but fails in the Preview window.bod
07/12/2023, 7:58 AM@Preview
@Composable
private fun LaunchDetailsPreview() {
LaunchDetails(
LaunchDetailsQuery("42").parseJsonResponse("{some json}").data!!,
)
}
goku
07/12/2023, 8:01 AMmbonnin
07/12/2023, 8:01 AMmbonnin
07/12/2023, 8:02 AMokio
mbonnin
07/12/2023, 8:07 AMApolloJsonParserCan you double check this @goku? I don't think we have a
ApolloJsonParser
in 3.8.1bod
07/12/2023, 11:22 AM./gradlew :app:dependencies
and ./gradlew :app:buildEnvironment
to see what version(s) of Okio you may have - the one coming from Apollo should be 3.2.0.